error callback on undefined hostname at multiple levels
This commit is contained in:
		
							parent
							
								
									cc13d3d607
								
							
						
					
					
						commit
						9f31326a5a
					
				| @ -126,6 +126,11 @@ module.exports.create = function (opts) { | |||||||
|     if (opts.debug) { |     if (opts.debug) { | ||||||
|       console.debug("[LEX] '" + hostname + "' is not registered, requesting approval"); |       console.debug("[LEX] '" + hostname + "' is not registered, requesting approval"); | ||||||
|     } |     } | ||||||
|  |      | ||||||
|  |     if (!hostname) { | ||||||
|  |       sniCb(new Error('[registerCert] no hostname')); | ||||||
|  |       return; | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|     opts.approveRegistration(hostname, function (err, args) { |     opts.approveRegistration(hostname, function (err, args) { | ||||||
| 
 | 
 | ||||||
| @ -157,6 +162,11 @@ module.exports.create = function (opts) { | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   function fetch(hostname, sniCb) { |   function fetch(hostname, sniCb) { | ||||||
|  |     if (!hostname) { | ||||||
|  |       sniCb(new Error('[sniCallback] [fetch] no hostname')); | ||||||
|  |       return; | ||||||
|  |     } | ||||||
|  |      | ||||||
|     opts.letsencrypt.fetch({ domains: [hostname] }, function (err, certInfo) { |     opts.letsencrypt.fetch({ domains: [hostname] }, function (err, certInfo) { | ||||||
|       if (opts.debug) { |       if (opts.debug) { | ||||||
|         console.debug("[LEX] fetch from disk result '" + hostname + "':"); |         console.debug("[LEX] fetch from disk result '" + hostname + "':"); | ||||||
| @ -184,7 +194,10 @@ module.exports.create = function (opts) { | |||||||
|     var now = Date.now(); |     var now = Date.now(); | ||||||
|     var certInfo = ipc[hostname]; |     var certInfo = ipc[hostname]; | ||||||
| 
 | 
 | ||||||
| 
 |     if (!hostname) { | ||||||
|  |       cb(new Error('[sniCallback] no hostname')); | ||||||
|  |       return; | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|     //
 |     //
 | ||||||
|     // No cert is available in cache.
 |     // No cert is available in cache.
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user