From 557e0b61b057c4ea9cc378b020b63673dcfd565f Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Fri, 9 Feb 2024 18:10:02 +0100 Subject: [PATCH] fix client datatype --- src/client/mod.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/client/mod.rs b/src/client/mod.rs index 00a69e9..084897e 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -11,7 +11,7 @@ use tokio::{ net::TcpStream, }; use tokio_rustls::{ - rustls::{self, pki_types}, TlsConnector, TlsStream + rustls::{self, pki_types}, TlsConnector, client::TlsStream }; use webpki_roots; @@ -20,8 +20,6 @@ const BUF_SIZE: usize = 512; pub struct Client { cfg: Config, stream: TlsStream, - connector: TlsConnector, - domain: pki_types::ServerName<'static>, } impl Client { @@ -47,13 +45,11 @@ 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, - connector, - domain, }) }