tide-rustls icon indicating copy to clipboard operation
tide-rustls copied to clipboard

"how do I" - TLS connection information

Open Spindel opened this issue 5 years ago • 2 comments

I'd like to be able to access the rustls::Session object, in order to access the metadata information on it ( get_negotiated_ciphersuite, get_peer_certificates , etc.)

However, I seem to be getting lost in the layers of tide / async_rustls wrappings and I end up unable to really figure it out.

Is there some (easy?) way to access that metadata?

Spindel avatar Nov 04 '20 15:11 Spindel

Not yet, thanks for the suggestion! I'll put some thought into the right way to expose this :thumbsup:

jbr avatar Nov 04 '20 18:11 jbr

Thanks!

To be clear, rustls::Session is the common trait for ClientSession/ServerSession structs, (documented here, https://docs.rs/rustls/0.18.1/rustls/trait.Session.html )

It should be accessible via the rustls Stream struct as ".sess" ( https://docs.rs/rustls/0.18.1/rustls/struct.Stream.html ) where one also can get the socket, which is needed to get the remote pair of ip/port data.

Spindel avatar Nov 04 '20 18:11 Spindel