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

peer_certificate returns None, even if there is a secure connection with a client certificate #3218

Closed
jarlah opened this issue May 4, 2023 · 3 comments
Labels
C-bug Category: bug. Something is wrong. This is bad!

Comments

@jarlah
Copy link

jarlah commented May 4, 2023

Version
hyper 1.0.0-rc.3
tokio-native-tls 0.3.1
native-tls 0.2.11

Platform
Darwin [....] 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar 6 20:59:58 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6020 arm64
aka macOS 13.3.1 Ventura

Description
tls_stream.get_ref().peer_certificate() returns None, even if there is a secure connection with a client certificate. I have a full working example, where I am struggling to find out why hyper is not able to find the peer certificate. I expect it to return the peer certificate, the certificate passed into the curl command with --cacert ca.pem --cert client.pem --cert-type PEM.

See guillaumepellegrino/acsrs#6 (comment) for a concrete example reproducing the exact behaviour. Are we doing it wrong? Or are we assuming that peer certificate should return something it can't?

@jarlah jarlah added the C-bug Category: bug. Something is wrong. This is bad! label May 4, 2023
@seanmonstar
Copy link
Member

I don't think this has anything to do with hyper. You're trying access the certificate from the IO transport, which seems to be from native-tls?

@jarlah
Copy link
Author

jarlah commented May 4, 2023

Fair point @seanmonstar but is there no examples of an hyper server that uses Peer cert ? Do you know of any ? I will Close this and make issue in native tls or tokio native tls.

@seanmonstar seanmonstar closed this as not planned Won't fix, can't repro, duplicate, stale May 4, 2023
@jarlah
Copy link
Author

jarlah commented May 5, 2023

made issue in rust-native-tls, with a concrete non hyper related repository. Raw usage of rust-native-tls. and it still doesn't give me peer cert .... sfackler/rust-native-tls#262

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug. Something is wrong. This is bad!
Projects
None yet
Development

No branches or pull requests

2 participants