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

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

Open
bdraco opened this issue Mar 19, 2023 · 3 comments

Comments

@bdraco
Copy link

bdraco commented Mar 19, 2023

self._session = self._session_instance or httpx.AsyncClient()

We recently discovered httpx does not perform well without passing in an ssl context (home-assistant/core#89932)

see encode/httpx#2609 encode/httpx#838 (comment)

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
Copy link
Collaborator

Shutgun commented Mar 19, 2023

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
Copy link
Author

bdraco commented Mar 19, 2023

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
Copy link
Author

bdraco commented Mar 19, 2023

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

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants