Cached ssl contexts. #3341
Unanswered
T-256
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
(Version 1.0 proposal)
Now we have
ssl_context=...for ssl context configuration for each client. When not used, by default we are create new isolatedhttpx.SSLContextper client instantiate. it's expensive and brings memory leak for high scale and multiple client uses. We want single global ssl context to use for client's default uses (nossl_context=...passed).clients in httpx can be configured to be compatible with
HTTP/1.1orHTTP2versions. TLS streams have ALPN (Application-Layer Protocol Negotiation) option in client hello packet to say to server what protocol could be used without extra roundtrip/connection upgrades. httpx should keep supported with ALPN standard. So, it should auto add ALPNs from passed http versions in Client instantiate.In #3340 prototype I added cached layer to httpx.SSLContext to support default ssl context. It uses class method which uses cached (or one-time generating if not available) ssl contexts for different http versions configurations.
I tried to keep related constructor to httpx.SSLContext, but I'm open to extract it to global context which then would be:
Beta Was this translation helpful? Give feedback.
All reactions