No TLS support
jonhoo opened this issue · comments
Jon Gjengset commented
Adding support for TLS should be fairly straightforward:
- Add a dependency on
native-tls
- Implement
StreamConnector
forTlsStream
Given that users may also want to be able to specify options, we might need some intermediate builder that exposes TlsConnectorBuilder
. I'm not entirely sure what the most ergonomic way to do this is, but one suggestions is to change StreamConnector
to:
pub trait StreamConnector {
type Addr: FromUrl;
type Stream: Read + Write + Sized + 'static;
fn connect(self, addr: Self::Addr) -> io::Result<Self::Stream>;
}
And the following impl
block for the connection methods on Client
to:
impl<C: StreamConnector> Client<C::Stream> {
This will require adding a little more code to the impl
for TcpStream
, but shouldn't be too bad.