Skip to content

Commit

Permalink
Merge pull request #261 from loopj/global-ssl-context-factory
Browse files Browse the repository at this point in the history
Set global ssl context factory on Vantage clients, fixes #251
  • Loading branch information
loopj authored Jan 27, 2025
2 parents 3d14de8 + 406bb63 commit 2ad45c3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions custom_components/vantage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
# How long to wait after receiving a system programming event before refreshing
SYSTEM_PROGRAMMING_DELAY = 30

# Use Home Assistant's default "no verify" SSL context for connections
Vantage.set_ssl_context_factory(get_default_no_verify_context)


async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up Vantage integration from a config entry."""
Expand All @@ -55,9 +58,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
entry.data[CONF_HOST],
entry.data.get(CONF_USERNAME),
entry.data.get(CONF_PASSWORD),
ssl=(
get_default_no_verify_context() if entry.data.get(CONF_SSL, True) else False
),
ssl=entry.data.get(CONF_SSL, True),
)

# Store the client in the hass data store
Expand Down

0 comments on commit 2ad45c3

Please sign in to comment.