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

Get the server's SSL certificate #1428

Closed
bramp opened this issue Jan 8, 2022 · 7 comments · Fixed by #1938
Closed

Get the server's SSL certificate #1428

bramp opened this issue Jan 8, 2022 · 7 comments · Fixed by #1938
Labels
E-pr-welcome The feature is welcome to be added, instruction should be found in the issue.

Comments

@bramp
Copy link

bramp commented Jan 8, 2022

Is it possible to extract the server's certificate chain from a Response? In addition to say SSL/TLS version, and other cipher information?

I looked at using use_preconfigured_tls and passing my own tls client, with a customer ServerCertVerifier but it

  1. Seems unclear how to tie back the specific request to the ServerCertVerifier verification calls (especially if I'm using the client to send many requests), and
  2. Seems to be duplicating a lot of code you already have.

thanks in advance

@seanmonstar
Copy link
Owner

Nope, it's not currently possible. The specific TLS libraries that reqwest uses may provide that information internally, but it'd take some work to collect it and present it on the Response. Even more work if the TLS connectors don't provide that info yet.

@bramp
Copy link
Author

bramp commented Jan 10, 2022

Would you accept a pull request, if I got this implemented (including in the underlying libraries) and it wasn't horrible, etc?

I suspect I'd create a HttpInfo like extension, that will contain various TLS information.

@seanmonstar
Copy link
Owner

Yes absolutely! I think some of the connectors may already insert an extension, like HttpInfo. But I haven't checked in a while.

@seanmonstar
Copy link
Owner

Ideally, whatever is exposed on the Response is a wrapper type from reqwest::tls, which doesn't expose the underlying TLS type.

@seanmonstar seanmonstar added the E-pr-welcome The feature is welcome to be added, instruction should be found in the issue. label Jan 27, 2022
@JRAndreassen
Copy link

Hi...
This is exactly what I'm looking for...
@bramp : Did you make any headway on this ?
Thanks
JR

@bramp
Copy link
Author

bramp commented Apr 26, 2022

ah sorry, I found a workaround by not using reqwest, so have not made progress, and will likely not make progress in the short term.

@JRAndreassen
Copy link

@bramp,
Ahh, yes... "there is a crate for that"...
I was hoping to avoid hitting it again...
Thanks for letting me know.
JR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-pr-welcome The feature is welcome to be added, instruction should be found in the issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants