Value of http2 not being passed on to create_ssl_context
#3126
Replies: 1 comment 2 replies
-
|
Well spotted, you've found an unused appendix there... here's the deal... There's two places where we need to know if HTTP/2 is enabled or not...
This is actually a bit awkward... ideally we'd just set that in one place (the SSL context) and then have the connection pool determine the correct behavior based on that. However, there's no API for reading the ALPN context. Currently we're mutating the SSL context within the connection pool to ensure that it has the correct ALPN context. We can either...
Ideally there's also some more comprehensive documentation for us to include here. I'd suggest that we look at resolving this once #3022 has landed. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am not super-familiar with the innards of this repo, but in debugging something else I tangentially noticed from the log this entry, showing
http2=Falseeven though is generated when instantiating an object withhttpx.Client(http2=**True**):I have isolated this behavior to the two lines below, each calling
create_ssl_contextbut without passinghttp2as an argument, sohttp2is defaulted toFalse.httpx/httpx/_transports/default.py
Line 138 in f3eb3c9
httpx/httpx/_transports/default.py
Line 279 in f3eb3c9
I presume that
create_ssl_contextwould not have been written with ahttp2parameter unless it was useful, yet thehttp2argument is never used in the code as these are the only two lines of code who call it.Are those two lines correct or should
http2be passed onwards?Beta Was this translation helpful? Give feedback.
All reactions