cache secureContext
This commit is contained in:
parent
51249791aa
commit
cb898418f2
6
serve.js
6
serve.js
|
@ -132,6 +132,7 @@ function run() {
|
||||||
|
|
||||||
// letsencrypt
|
// letsencrypt
|
||||||
var cert = require('localhost.daplie.com-certificates').merge({});
|
var cert = require('localhost.daplie.com-certificates').merge({});
|
||||||
|
var secureContext;
|
||||||
|
|
||||||
var opts = {
|
var opts = {
|
||||||
agreeTos: argv.agreeTos || argv['agree-tos']
|
agreeTos: argv.agreeTos || argv['agree-tos']
|
||||||
|
@ -147,7 +148,10 @@ function run() {
|
||||||
var peerCa;
|
var peerCa;
|
||||||
|
|
||||||
opts.httpsOptions.SNICallback = function (servername, cb) {
|
opts.httpsOptions.SNICallback = function (servername, cb) {
|
||||||
cb(null, tls.createSecureContext(opts.httpsOptions));
|
if (!secureContext) {
|
||||||
|
secureContext = tls.createSecureContext(opts.httpsOptions);
|
||||||
|
}
|
||||||
|
cb(null, secureContext);
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue