load default tls certs
This commit is contained in:
		
							parent
							
								
									46aebe069f
								
							
						
					
					
						commit
						28198dda87
					
				@ -36,7 +36,7 @@ function loadCerts(secureContexts, certPaths, domainname, prevdomainname) {
 | 
				
			|||||||
    // guard against race condition on Promise.some
 | 
					    // guard against race condition on Promise.some
 | 
				
			||||||
    if (prevdomainname && !secureContexts[prevdomainname]) {
 | 
					    if (prevdomainname && !secureContexts[prevdomainname]) {
 | 
				
			||||||
      // TODO XXX make sure that letsencrypt www. domains handle the bare domains also (and vice versa)
 | 
					      // 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];
 | 
					    return secureContexts[domainname];
 | 
				
			||||||
 | 
				
			|||||||
@ -25,6 +25,9 @@ module.exports.create = function (certPaths, serverCallback) {
 | 
				
			|||||||
    , honorCipherOrder: true
 | 
					    , 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
 | 
					    //SNICallback is passed the domain name, see NodeJS docs on TLS
 | 
				
			||||||
    secureOpts.SNICallback = function (domainname, cb) {
 | 
					    secureOpts.SNICallback = function (domainname, cb) {
 | 
				
			||||||
      // NOTE: '*.proxyable.*' domains will be truncated
 | 
					      // NOTE: '*.proxyable.*' domains will be truncated
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user