load default tls certs

This commit is contained in:
AJ ONeal 2015-11-23 08:42:25 +00:00
父節點 46aebe069f
當前提交 28198dda87
共有 2 個檔案被更改,包括 4 行新增1 行删除

查看文件

@ -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];

查看文件

@ -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