diff --git a/src/client/mod.rs b/src/client/mod.rs index 00a69e9..cb8c325 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -11,7 +11,8 @@ use tokio::{ net::TcpStream, }; use tokio_rustls::{ - rustls::{self, pki_types}, TlsConnector, TlsStream + rustls::{self, pki_types}, + TlsConnector, TlsStream, }; use webpki_roots; @@ -47,11 +48,13 @@ impl Client { return Err(err.into()); } }; - let mut stream = connector.connect(domain, TcpStream::connect(&cfg.addr).await?).await?; + let stream = connector + .connect(domain.clone(), TcpStream::connect(&cfg.addr).await?) + .await?; Ok(Client { cfg: cfg.clone(), - stream, + stream: tokio_rustls::TlsStream::Client(stream), connector, domain, })