From c2cd94fcaac6299c376dfa64b992f56ae3d09184 Mon Sep 17 00:00:00 2001 From: Fabian Ising Date: Mon, 12 Sep 2022 13:20:23 +0200 Subject: [PATCH] Add host:port printing to SSL/TLS connection errors --- lib/request/httpshandler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/request/httpshandler.py b/lib/request/httpshandler.py index 998fbd2c8..4ea320a68 100644 --- a/lib/request/httpshandler.py +++ b/lib/request/httpshandler.py @@ -86,7 +86,7 @@ class HTTPSConnection(_http_client.HTTPSConnection): sock.close() except (ssl.SSLError, socket.error, _http_client.BadStatusLine) as ex: self._tunnel_host = None - logger.debug("SSL connection error occurred for '%s' ('%s')" % (_lut[protocol], getSafeExString(ex))) + logger.debug("SSL connection error occurred for '%s' on '%s:%d' ('%s')" % (_lut[protocol], self.host, self.port, getSafeExString(ex))) if kb.tlsSNI.get(self.host) is None: kb.tlsSNI[self.host] = success @@ -106,7 +106,7 @@ class HTTPSConnection(_http_client.HTTPSConnection): sock.close() except (ssl.SSLError, socket.error, _http_client.BadStatusLine) as ex: self._tunnel_host = None - logger.debug("SSL connection error occurred for '%s' ('%s')" % (_lut[protocol], getSafeExString(ex))) + logger.debug("SSL connection error occurred for '%s' on '%s:%d' ('%s')" % (_lut[protocol], self.host, self.port, getSafeExString(ex))) if not success: errMsg = "can't establish SSL connection"