main: Catch the CertificateError exception when doing the ssl handshake.

This commit is contained in:
Damir Jelić 2018-10-15 22:14:43 +02:00
parent 0a8e491b00
commit 8f1c79e640

View file

@ -223,7 +223,7 @@ def try_ssl_handshake(server):
return False return False
except (ssl.SSLError, socket.error) as error: except (ssl.SSLError, ssl.CertificateError, socket.error) as error:
try: try:
str_error = error.reason if error.reason else "Unknown error" str_error = error.reason if error.reason else "Unknown error"
except AttributeError: except AttributeError: