2Fake / devolo_plc_api

devolo PLC device API in Python
GNU General Public License v3.0
19 stars 2 forks source link

Consider passing in an SSLContext when creating the httpx client if you need ssl #117

Open bdraco opened 1 year ago

bdraco commented 1 year ago

https://github.com/2Fake/devolo_plc_api/blob/81723576742175f14aa50814209812b480d2d8c3/devolo_plc_api/device.py#L123

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)

Shutgun commented 1 year ago

Hi @bdraco , just that I get the urgency right: if we use the client created by get_async_client (what we do), the issue will be handled for us. Other usages outside of Home Assistant are not running at best possible performance, but still work. Did I summarize it correctly?

bdraco commented 1 year ago

Hi @bdraco , just that I get the urgency right: if we use the client created by get_async_client (what we do), the issue will be handled for us.

Yes. If you do this already there is nothing to do.

bdraco commented 1 year ago

Other usages outside of Home Assistant are not running at best possible performance, but still work. Did I summarize it correctly?

Yes