Fix a mistake in Connection._do_tls_handshake(): return on exception,

log ssl.SSLError reason and discard the node.
This commit is contained in:
Lee Miller 2023-10-20 21:19:42 +03:00
parent 06e3797e23
commit b736463b20
Signed by untrusted user: lee.miller
GPG Key ID: 4F97A5EA88F4AB63
1 changed files with 4 additions and 1 deletions

View File

@ -231,7 +231,10 @@ class Connection(threading.Thread):
'Disconnecting from %s:%s. Reason: %s',
self.host_print, self.port, e)
self.status = 'disconnecting'
break
if isinstance(e, ssl.SSLError): # pylint: disable=no-member
logging.debug('ssl.SSLError reason: %s', e.reason)
shared.node_pool.discard((self.host, self.port))
return
self.tls = True
logging.debug(
'Established TLS connection with %s:%s (%s)',