From cd6a5c21d2d598b46595354de7aab9ac50e634e2 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Wed, 21 Aug 2024 11:56:52 +0200 Subject: [PATCH] fix bugs --- src/client/mod.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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, })