mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-09 17:04:29 +02:00
added ssl_handshake_failure error for UI
This commit is contained in:
parent
81aa8d0bd5
commit
e2c81c950f
3 changed files with 7 additions and 1 deletions
|
@ -18,6 +18,7 @@
|
|||
"error": {
|
||||
"name_exists": "Name already exists.",
|
||||
"cannot_connect": "Cannot connect to Mikrotik.",
|
||||
"ssl_handshake_failure": "SSL handshake failure",
|
||||
"connection_timeout": "Mikrotik connection timeout.",
|
||||
"wrong_login": "Invalid user name or password."
|
||||
}
|
||||
|
|
|
@ -75,7 +75,8 @@ class MikrotikAPI:
|
|||
librouteros.exceptions.MultiTrapError,
|
||||
librouteros.exceptions.ConnectionClosed,
|
||||
librouteros.exceptions.ProtocolError,
|
||||
librouteros.exceptions.FatalError
|
||||
librouteros.exceptions.FatalError,
|
||||
ssl.SSLError
|
||||
) as api_error:
|
||||
_LOGGER.error("Mikrotik %s: %s", self._host, api_error)
|
||||
self.error_to_strings("%s" % api_error)
|
||||
|
@ -96,6 +97,9 @@ class MikrotikAPI:
|
|||
if error == "invalid user name or password (6)":
|
||||
self.error = "wrong_login"
|
||||
|
||||
if "ALERT_HANDSHAKE_FAILURE" in error:
|
||||
self.error = "ssl_handshake_failure"
|
||||
|
||||
return
|
||||
|
||||
# ---------------------------
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
"error": {
|
||||
"name_exists": "Name already exists.",
|
||||
"cannot_connect": "Cannot connect to Mikrotik.",
|
||||
"ssl_handshake_failure": "SSL handshake failure",
|
||||
"connection_timeout": "Mikrotik connection timeout.",
|
||||
"wrong_login": "Invalid user name or password."
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue