main: Handle socket errors during the SSL handshake.
This commit is contained in:
parent
9e6bd0c246
commit
35e6978622
1 changed files with 6 additions and 3 deletions
5
main.py
5
main.py
|
@ -239,8 +239,11 @@ def try_ssl_handshake(server):
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
except ssl.SSLError as error:
|
except (ssl.SSLError, socket.error) as error:
|
||||||
|
try:
|
||||||
str_error = error.reason if error.reason else "Unknown error"
|
str_error = error.reason if error.reason else "Unknown error"
|
||||||
|
except AttributeError:
|
||||||
|
str_error = str(error)
|
||||||
|
|
||||||
message = ("{prefix}Error while doing SSL handshake"
|
message = ("{prefix}Error while doing SSL handshake"
|
||||||
": {error}").format(
|
": {error}").format(
|
||||||
|
|
Loading…
Reference in a new issue