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

tokio-tls should expose methods on TlsStream #1383

Closed
sfackler opened this issue Aug 3, 2019 · 8 comments
Closed

tokio-tls should expose methods on TlsStream #1383

sfackler opened this issue Aug 3, 2019 · 8 comments
Assignees

Comments

@sfackler
Copy link
Contributor

sfackler commented Aug 3, 2019

Version

master

Subcrates

tokio-tls

Description

native_tls::TlsStream has various methods defined to access the underlying stream, the peer's certificate, and channel binding information. Now that tokio_tls::TlsStream doesn't publicly expose the inner native_tls stream, it will need to directly define equivalent methods.

https://docs.rs/native-tls/0.2.3/native_tls/struct.TlsStream.html

@sfackler sfackler changed the title tokio-tls should expose methods on SslStream tokio-tls should expose methods on RlaStream Aug 3, 2019
@sfackler sfackler changed the title tokio-tls should expose methods on RlaStream tokio-tls should expose methods on TlsStream Aug 3, 2019
@carllerche carllerche added this to the v0.2 milestone Aug 9, 2019
@campbellC
Copy link

It seems that this was possible in v0.2.1 but in the latest alpha version the same function now drops straight down to the underlying inner stream. Was this an intentional reversion? I would very much like access to the certificates of Tls connections.

@aklitzke
Copy link

I'd like to bump this. Ran into this issue as well, I would also like to access the underlying certificates, and other native tls methods on TlsStream would be handy. I had to hack up the library to get them.

@aloucks
Copy link

aloucks commented Feb 15, 2020

Any update on this? Would you accept a PR that added additional methods to get the native tls stream?

@carllerche
Copy link
Member

cc @LucioFranco

@LucioFranco
Copy link
Member

@aloucks sure! we are currently in the process of moving things to tokio-rs/tls so I'd be happy to accept a PR there.

aloucks added a commit to aloucks/tls that referenced this issue Feb 26, 2020
aloucks added a commit to aloucks/tls that referenced this issue Feb 27, 2020
LucioFranco pushed a commit to tokio-rs/tls that referenced this issue Feb 28, 2020
@campbellC
Copy link

I’ve upgraded to the latest version and this works fine for me. This issue can be closed, thanks!

@hbobenicio
Copy link

Hey @campbellC , would you mind sharing your example?

@campbellC
Copy link

@hbobenicio sure - I'm using this here to pull out the certificate and then spoof the contents for a man-in-the-middle proxy clone that I'm writing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants