From 1126125d7088253e7a8751ca6ca31aa3af71aaa9 Mon Sep 17 00:00:00 2001 From: hozan23 Date: Tue, 12 Mar 2024 21:54:29 +0100 Subject: upgrade from async-rustls to futures-rustls --- net/src/transports/tls.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'net/src/transports') diff --git a/net/src/transports/tls.rs b/net/src/transports/tls.rs index 8a43d7d..83f7a11 100644 --- a/net/src/transports/tls.rs +++ b/net/src/transports/tls.rs @@ -1,7 +1,7 @@ use std::sync::Arc; -use async_rustls::{rustls, TlsAcceptor, TlsConnector, TlsStream}; use async_trait::async_trait; +use futures_rustls::{pki_types, rustls, TlsAcceptor, TlsConnector, TlsStream}; use smol::{ io::{split, AsyncReadExt, AsyncWriteExt, ReadHalf, WriteHalf}, lock::Mutex, @@ -63,7 +63,7 @@ pub async fn dial_tls( addr: &Addr, port: &Port, config: rustls::ClientConfig, - dns_name: &str, + dns_name: &'static str, ) -> Result { let address = format!("{}:{}", addr, port); @@ -72,7 +72,7 @@ pub async fn dial_tls( let sock = TcpStream::connect(&address).await?; sock.set_nodelay(true)?; - let altname = rustls::ServerName::try_from(dns_name)?; + let altname = pki_types::ServerName::try_from(dns_name)?; let conn = connector.connect(altname, sock.clone()).await?; Ok(TlsConn::new(sock, TlsStream::Client(conn))) } @@ -81,7 +81,7 @@ pub async fn dial_tls( pub async fn dial( endpoint: &Endpoint, config: rustls::ClientConfig, - dns_name: &str, + dns_name: &'static str, ) -> Result> { match endpoint { Endpoint::Tcp(..) | Endpoint::Tls(..) => {} -- cgit v1.2.3