-
-
Notifications
You must be signed in to change notification settings - Fork 869
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
Document the extensions
API.
#2599
Comments
I cannot assert that using extensions will help solve my problem. I assumed that the transport would contain information about the version of TLS used and the encryption method, but I only found information on how to output the minimum and maximum versions of TLS, as well as the available encryption methods. Example how i found min/max available TLS versions (Please don't throw stones at me):
I found info here:
|
Take a look at the
# You'll probably want to use `httpx` (or an httpx client instance) here instead of `httpcore`.
# The extension works the same way...
with httpcore.stream("GET", "https://www.example.com") as response:
network_stream = response.extensions["network_stream"]
ssl_object = network_stream.get_extra_info("ssl_object")
print("TLS version", ssl_object.version()) |
Another user asking the same question, but looking for the |
We have some documentation on the
extensions
API in thehttpcore
docs, but I don't see anywhere that we're referencing it inhttpx
.Maybe we need an extra section in the "Advanced Usage" docs?
Prompted by #2552
Originally posted by al3x4kov January 22, 2023
Hi!
i have this code:
async with httpx.AsyncClient(verify=False if not ca_bundle else ca_bundle, timeout=timeout) as client:
rsp = await client.request( method="GET", url=url, headers=headers )
ca_bundle is a path like /tmp/ca_bundle
timeout = 30.0
Everything is ok, i get response but the main question is what i should add in my code to have in log strings like:
console.print(f"* SSL established using {version!r} / {cipher[0]!r}")
This line from def trace from httpx/_main.py
I found that in client.request i can add parameter
extensions
, but i can't really understand what to pass inI tried to use TRACE logging type - doesn't work for me. I see only this lines.

The text was updated successfully, but these errors were encountered: