mirror of
				https://github.com/therootcompany/greenlock-express.js.git
				synced 2024-11-16 17:28:59 +00:00 
			
		
		
		
	bail when no servername is available
This commit is contained in:
		
							parent
							
								
									ffbcc433b3
								
							
						
					
					
						commit
						9ae6a768a7
					
				
							
								
								
									
										10
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								index.js
									
									
									
									
									
								
							| @ -62,10 +62,12 @@ module.exports.create = function (opts) { | |||||||
|             greenlock.servername = greenlock.approvedDomains[0]; |             greenlock.servername = greenlock.approvedDomains[0]; | ||||||
|           } |           } | ||||||
|         } |         } | ||||||
|  | 
 | ||||||
|         if (!greenlock.servername) { |         if (!greenlock.servername) { | ||||||
|           resolve(null); |           resolve(null); | ||||||
|           return; |           return; | ||||||
|         } |         } | ||||||
|  | 
 | ||||||
|         return greenlock.check({ domains: [ greenlock.servername ] }).then(function (certs) { |         return greenlock.check({ domains: [ greenlock.servername ] }).then(function (certs) { | ||||||
|           if (certs) { |           if (certs) { | ||||||
|             return { |             return { | ||||||
| @ -127,9 +129,11 @@ module.exports.create = function (opts) { | |||||||
|     greenlock.tlsOptions.SNICallback = function (domain, cb) { |     greenlock.tlsOptions.SNICallback = function (domain, cb) { | ||||||
|       sniCallback(domain, function (err, context) { |       sniCallback(domain, function (err, context) { | ||||||
|         cb(err, context); |         cb(err, context); | ||||||
|         if (!context || server._hasDefaultSecureContext) { | 
 | ||||||
|           return; |         if (!context || server._hasDefaultSecureContext) { return; } | ||||||
|         } |         if (!domain) { domain = greenlock.servername; } | ||||||
|  |         if (!domain) { return; } | ||||||
|  | 
 | ||||||
|         return greenlock.check({ domains: [ domain ] }).then(function (certs) { |         return greenlock.check({ domains: [ domain ] }).then(function (certs) { | ||||||
|           // ignore the case that check doesn't have all the right args here
 |           // ignore the case that check doesn't have all the right args here
 | ||||||
|           // to get the same certs that it just got (eventually the right ones will come in)
 |           // to get the same certs that it just got (eventually the right ones will come in)
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user