do'nt try starttls if stream version < 1.0. Fixes #4600
This commit is contained in:
		
							parent
							
								
									f8831b947d
								
							
						
					
					
						commit
						45f9366d58
					
				
					 1 changed files with 5 additions and 5 deletions
				
			
		| 
						 | 
					@ -329,16 +329,16 @@ class NonBlockingClient:
 | 
				
			||||||
				# if we want plain connection, we're done now
 | 
									# if we want plain connection, we're done now
 | 
				
			||||||
				self._on_connect()
 | 
									self._on_connect()
 | 
				
			||||||
				return
 | 
									return
 | 
				
			||||||
			if not self.Dispatcher.Stream.features.getTag('starttls'):
 | 
					 | 
				
			||||||
				# if server doesn't advertise TLS in init response, we can't do more
 | 
					 | 
				
			||||||
				log.warn('While connecting with type = "tls": TLS unsupported by remote server')
 | 
					 | 
				
			||||||
				self._on_connect()
 | 
					 | 
				
			||||||
				return
 | 
					 | 
				
			||||||
			if self.incoming_stream_version() != '1.0':
 | 
								if self.incoming_stream_version() != '1.0':
 | 
				
			||||||
				# if stream version is less than 1.0, we can't do more
 | 
									# if stream version is less than 1.0, we can't do more
 | 
				
			||||||
				log.warn('While connecting with type = "tls": stream version is less than 1.0')
 | 
									log.warn('While connecting with type = "tls": stream version is less than 1.0')
 | 
				
			||||||
				self._on_connect()
 | 
									self._on_connect()
 | 
				
			||||||
				return
 | 
									return
 | 
				
			||||||
 | 
								if not self.Dispatcher.Stream.features.getTag('starttls'):
 | 
				
			||||||
 | 
									# if server doesn't advertise TLS in init response, we can't do more
 | 
				
			||||||
 | 
									log.warn('While connecting with type = "tls": TLS unsupported by remote server')
 | 
				
			||||||
 | 
									self._on_connect()
 | 
				
			||||||
 | 
									return
 | 
				
			||||||
			# otherwise start TLS negotioation
 | 
								# otherwise start TLS negotioation
 | 
				
			||||||
			self.stream_started = False
 | 
								self.stream_started = False
 | 
				
			||||||
			log.info("TLS supported by remote server. Requesting TLS start.")
 | 
								log.info("TLS supported by remote server. Requesting TLS start.")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue