You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					16 lines
				
				558 B
			
		
		
			
		
	
	
					16 lines
				
				558 B
			| 
											3 years ago
										 | 'use strict'; | ||
|  | 
 | ||
|  | const getConstructorName = require('../getConstructorName'); | ||
|  | 
 | ||
|  | const nonSSLMessage = 'Client network socket disconnected before secure TLS ' + | ||
|  |   'connection was established'; | ||
|  | 
 | ||
|  | module.exports = function isSSLError(topologyDescription) { | ||
|  |   if (getConstructorName(topologyDescription) !== 'TopologyDescription') { | ||
|  |     return false; | ||
|  |   } | ||
|  | 
 | ||
|  |   const descriptions = Array.from(topologyDescription.servers.values()); | ||
|  |   return descriptions.length > 0 && | ||
|  |     descriptions.every(descr => descr.error && descr.error.message.indexOf(nonSSLMessage) !== -1); | ||
|  | }; |