From 5a65978678da73edc2aecb66a0de765506ab5ce6 Mon Sep 17 00:00:00 2001 From: Lee Miller Date: Fri, 20 Oct 2023 21:19:42 +0300 Subject: [PATCH] Fix a mistake in Connection._do_tls_handshake(): return on exception, log ssl.SSLError reason and discard the node. --- minode/connection.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/minode/connection.py b/minode/connection.py index bcb4332..ded5ae3 100644 --- a/minode/connection.py +++ b/minode/connection.py @@ -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)',