async-rs / async-tls

A TLS implementation over AsyncRead and AsyncWrite
https://async.rs
Apache License 2.0
167 stars 47 forks source link

Make session public in TlsStream #37

Closed xpepermint closed 3 years ago

xpepermint commented 4 years ago

Some very important data provided by Session are currently hidden (e.g. which protocol was selected by the handshake).

Ref: https://github.com/async-rs/async-tls/issues/30

xpepermint commented 4 years ago

@Momannn when this is merged you'll be able to get the selected ALPN protocol like this:

use rustls::{Session}; // don't forget this
...
connector.connect("google.com", tcp_stream).await?;
socket.session.get_alpn_protocol();
dizda commented 3 years ago

Also waiting for this feature.

dizda commented 3 years ago

I personally need to set some stuff about the session, eg.

session.set_buffer_limit(1_000_000);
xpepermint commented 3 years ago

Status?

skade commented 3 years ago

As stated on other places on this tracker, I don't want to expose rusttls types directly. async-tls is rather intended to implement high-level operations on TLS connections rather than having users implement those themselves. It's also intended to be engine-independent.

I know I'm far away from this goal, as I was sidelined, which is the reason why I put a maintenance notice out, showing a path to a structured handover to new maintainers. It's important to me though that the above design is taken over along with it.