fix ssl check
This commit is contained in:
+4
-2
@@ -44,8 +44,10 @@ async def check_tcp_connection(host: str, port: int) -> bool:
|
||||
return True
|
||||
except ssl.SSLError as e:
|
||||
err_text = str(e)
|
||||
if "hostname mismatch" in err_text or "certificate is not valid for" in err_text:
|
||||
return False
|
||||
if ("hostname mismatch" in err_text or
|
||||
"certificate is not valid for" in err_text or
|
||||
"sslv3 alert handshake failure" in err_text):
|
||||
return True
|
||||
logger.warning(f"[SSL Error] Сертификат сервера {host} вызвал ошибку: {e}")
|
||||
await notify_ssl_error(host, err_text)
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user