Pass verify_ssl to created session in Omada (#109212)

* Pass verify_ssl to created session in Omada

* Fix tests

* Fix tests
pull/109271/head
Joost Lekkerkerker 2024-02-01 03:38:16 +01:00 committed by GitHub
parent 2b525ed2e9
commit 31094e72a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

@ -61,7 +61,9 @@ async def create_omada_client(
is not None
):
# 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:
websession = async_get_clientsession(hass, verify_ssl=verify_ssl)

View File

@ -401,7 +401,7 @@ async def test_create_omada_client_with_ip_creates_clientsession(
hass,
{
"host": "10.10.10.10",
"verify_ssl": True, # Verify is meaningless for IP
"verify_ssl": True,
"username": "test-username",
"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"
)
mock_create_clientsession.assert_called_once_with(
hass, cookie_jar=mock_jar.return_value
hass, cookie_jar=mock_jar.return_value, verify_ssl=True
)