load default tls certs

This commit is contained in:
AJ ONeal 2015-11-23 08:42:25 +00:00
parent 46aebe069f
commit 28198dda87
2 changed files with 4 additions and 1 deletions

View File

@ -36,7 +36,7 @@ function loadCerts(secureContexts, certPaths, domainname, prevdomainname) {
// guard against race condition on Promise.some
if (prevdomainname && !secureContexts[prevdomainname]) {
// TODO XXX make sure that letsencrypt www. domains handle the bare domains also (and vice versa)
secureContexts[prevdomainname] = secureContexts[domainname];
secureContexts[prevdomainname] = secureContexts[domainname];
}
return secureContexts[domainname];

View File

@ -25,6 +25,9 @@ module.exports.create = function (certPaths, serverCallback) {
, honorCipherOrder: true
};
secureContexts['www.example.com'] = require('tls').createSecureContext(secureOpts);
secureContexts['example.com'] = secureContexts['www.example.com'];
//SNICallback is passed the domain name, see NodeJS docs on TLS
secureOpts.SNICallback = function (domainname, cb) {
// NOTE: '*.proxyable.*' domains will be truncated