mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-09 00:44:32 +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": {
|
"error": {
|
||||||
"name_exists": "Name already exists.",
|
"name_exists": "Name already exists.",
|
||||||
"cannot_connect": "Cannot connect to Mikrotik.",
|
"cannot_connect": "Cannot connect to Mikrotik.",
|
||||||
|
"ssl_handshake_failure": "SSL handshake failure",
|
||||||
"connection_timeout": "Mikrotik connection timeout.",
|
"connection_timeout": "Mikrotik connection timeout.",
|
||||||
"wrong_login": "Invalid user name or password."
|
"wrong_login": "Invalid user name or password."
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,8 @@ class MikrotikAPI:
|
||||||
librouteros.exceptions.MultiTrapError,
|
librouteros.exceptions.MultiTrapError,
|
||||||
librouteros.exceptions.ConnectionClosed,
|
librouteros.exceptions.ConnectionClosed,
|
||||||
librouteros.exceptions.ProtocolError,
|
librouteros.exceptions.ProtocolError,
|
||||||
librouteros.exceptions.FatalError
|
librouteros.exceptions.FatalError,
|
||||||
|
ssl.SSLError
|
||||||
) as api_error:
|
) as api_error:
|
||||||
_LOGGER.error("Mikrotik %s: %s", self._host, api_error)
|
_LOGGER.error("Mikrotik %s: %s", self._host, api_error)
|
||||||
self.error_to_strings("%s" % api_error)
|
self.error_to_strings("%s" % api_error)
|
||||||
|
@ -95,6 +96,9 @@ class MikrotikAPI:
|
||||||
self.error = "cannot_connect"
|
self.error = "cannot_connect"
|
||||||
if error == "invalid user name or password (6)":
|
if error == "invalid user name or password (6)":
|
||||||
self.error = "wrong_login"
|
self.error = "wrong_login"
|
||||||
|
|
||||||
|
if "ALERT_HANDSHAKE_FAILURE" in error:
|
||||||
|
self.error = "ssl_handshake_failure"
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
"error": {
|
"error": {
|
||||||
"name_exists": "Name already exists.",
|
"name_exists": "Name already exists.",
|
||||||
"cannot_connect": "Cannot connect to Mikrotik.",
|
"cannot_connect": "Cannot connect to Mikrotik.",
|
||||||
|
"ssl_handshake_failure": "SSL handshake failure",
|
||||||
"connection_timeout": "Mikrotik connection timeout.",
|
"connection_timeout": "Mikrotik connection timeout.",
|
||||||
"wrong_login": "Invalid user name or password."
|
"wrong_login": "Invalid user name or password."
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue