// mods/tls.rs use crate::Config; use tokio::net::TcpStream; use tokio_native_tls::{native_tls::TlsConnector as NTlsConnector, TlsConnector}; // Establish a TLS connection to the server pub async fn tls_exec( config: &Config, tcp_stream: TcpStream, ) -> Result, Box> { let tls_builder = NTlsConnector::builder() .danger_accept_invalid_certs(true) .build() .unwrap(); let tls_connector = TlsConnector::from(tls_builder); Ok(tls_connector .connect(&config.server, tcp_stream) .await .unwrap()) }