Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass verify_ssl to created session in Omada #109212

Merged
merged 3 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion homeassistant/components/tplink_omada/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions tests/components/tplink_omada/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand All @@ -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
)
Loading