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