From d9c7d8efe33f6e9d3f7cef1536e698f7fb5379e6 Mon Sep 17 00:00:00 2001 From: Sukhbir Singh Date: Sun, 3 May 2020 18:51:50 -0400 Subject: [PATCH] Handle SSLError and return the error string --- esnicheck/check.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esnicheck/check.py b/esnicheck/check.py index dbd4ea1..0b7c2bc 100644 --- a/esnicheck/check.py +++ b/esnicheck/check.py @@ -160,8 +160,8 @@ def has_tls13(self): protocol = ssock.version() except (ConnectionRefusedError, ConnectionResetError): return (False, "Unable to connect to port 443") - except ssl.CertificateError as error: - return (False, error.verify_message) + except ssl.SSLError as error: + return (False, error.reason) except socket.gaierror: return (False, "Hostname lookup failed") except socket.timeout: