diff --git a/sslyze/connection_helpers/tls_connection.py b/sslyze/connection_helpers/tls_connection.py index 60963349..49631dec 100644 --- a/sslyze/connection_helpers/tls_connection.py +++ b/sslyze/connection_helpers/tls_connection.py @@ -315,7 +315,7 @@ def connect(self, should_retry_connection: bool = True) -> None: ) except OSError as e: # OSError is the parent of all (non-TLS) socket/connection errors so it should be last - if "Nassl SSL handshake failed" in e.args[0]: + if "Nassl SSL handshake failed" in str(e.args): # Special error returned by nassl raise ServerRejectedTlsHandshake( server_location=self._server_location,