rustls / hyper-rustls

Integration between hyper HTTP library and rustls TLS stack
Other
312 stars 145 forks source link

Access rustls::Session from hyper::Service #146

Open ipetr0v opened 3 years ago

ipetr0v commented 3 years ago

Currently the parameters of hyper::Service::call only include a Request. And I'm curious if it's possible to access rustls::Session somewhere from the Service.

Accessing TLS session could be useful for multiple reasons, for example for implementing applications that rely on the TLS Keying Material (provided by rustls::Session::export_keying_material).

cc @tiziano88

tiziano88 commented 3 years ago

BTW it looks that Request is just a generic parameter in Service, so maybe there is a way of passing a wrapper around the HTTP request that carries the TLS context along, and implement Service<Wrapper<Request>>?