|
@@ -59,7 +59,6 @@ class Client:
|
|
|
self._working = False
|
|
|
self._token = token
|
|
|
self._password = password
|
|
|
- self._ssl_context = None
|
|
|
self._encryption_complete = False
|
|
|
self._file_name = None
|
|
|
self._file_size = None
|
|
@@ -199,11 +198,16 @@ class Client:
|
|
|
reader, writer = await asyncio.open_connection(
|
|
|
host=self.host,
|
|
|
port=self.port,
|
|
|
- ssl=self.ssl_context
|
|
|
+ ssl=self.ssl_context,
|
|
|
+ ssl_handshake_timeout=5
|
|
|
)
|
|
|
- except (ConnectionRefusedError, ConnectionResetError) as exception:
|
|
|
+ except (ConnectionRefusedError, ConnectionResetError,
|
|
|
+ ConnectionAbortedError) as exception:
|
|
|
logging.error(f"Connection error: {exception}")
|
|
|
return
|
|
|
+ except ssl.SSLCertVerificationError as exception:
|
|
|
+ logging.error(f"SSL error: {exception}")
|
|
|
+ return
|
|
|
await self.connect(reader=reader, writer=writer)
|
|
|
|
|
|
async def _connect(self, reader: asyncio.StreamReader,
|