Skip to content

Commit

Permalink
Handle SSLError and return the error string
Browse files Browse the repository at this point in the history
  • Loading branch information
azadi committed May 3, 2020
1 parent e5cb991 commit d9c7d8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions esnicheck/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d9c7d8e

Please sign in to comment.