Pass verify_ssl to created session in Omada (#109212)
* Pass verify_ssl to created session in Omada * Fix tests * Fix testspull/109271/head
parent
2b525ed2e9
commit
31094e72a0
|
@ -61,7 +61,9 @@ async def create_omada_client(
|
||||||
is not None
|
is not None
|
||||||
):
|
):
|
||||||
# TP-Link API uses cookies for login session, so an unsafe cookie jar is required for IP addresses
|
# TP-Link API uses cookies for login session, so an unsafe cookie jar is required for IP addresses
|
||||||
websession = async_create_clientsession(hass, cookie_jar=CookieJar(unsafe=True))
|
websession = async_create_clientsession(
|
||||||
|
hass, cookie_jar=CookieJar(unsafe=True), verify_ssl=verify_ssl
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
websession = async_get_clientsession(hass, verify_ssl=verify_ssl)
|
websession = async_get_clientsession(hass, verify_ssl=verify_ssl)
|
||||||
|
|
||||||
|
|
|
@ -401,7 +401,7 @@ async def test_create_omada_client_with_ip_creates_clientsession(
|
||||||
hass,
|
hass,
|
||||||
{
|
{
|
||||||
"host": "10.10.10.10",
|
"host": "10.10.10.10",
|
||||||
"verify_ssl": True, # Verify is meaningless for IP
|
"verify_ssl": True,
|
||||||
"username": "test-username",
|
"username": "test-username",
|
||||||
"password": "test-password",
|
"password": "test-password",
|
||||||
},
|
},
|
||||||
|
@ -412,5 +412,5 @@ async def test_create_omada_client_with_ip_creates_clientsession(
|
||||||
"https://10.10.10.10", "test-username", "test-password", "ws"
|
"https://10.10.10.10", "test-username", "test-password", "ws"
|
||||||
)
|
)
|
||||||
mock_create_clientsession.assert_called_once_with(
|
mock_create_clientsession.assert_called_once_with(
|
||||||
hass, cookie_jar=mock_jar.return_value
|
hass, cookie_jar=mock_jar.return_value, verify_ssl=True
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue