flz / iaqualink-py

Asynchronous library for Jandy iAqualink
BSD 3-Clause "New" or "Revised" License
30 stars 20 forks source link

Consider passing in an SSLContext when creating the httpx client #27

Closed bdraco closed 4 months ago

bdraco commented 1 year ago

https://github.com/flz/iaqualink-py/blob/01419eb13ba2e946026c2a6270d6d4528ea39178/src/iaqualink/client.py#L93

We recently discovered httpx does not perform well without passing in an ssl context (https://github.com/home-assistant/core/pull/89932)

see https://github.com/encode/httpx/pull/2609 https://github.com/encode/httpx/issues/838#issuecomment-1289927214

The shared helper will be updated for this issue as well so it can be used and passed the library

from homeassistant.helpers.httpx_client import get_async_client to get the shared client

from homeassistant.helpers.httpx_client import create_async_httpx_client to create a new one (if you need to recreate or need you own)