aboutsummaryrefslogtreecommitdiff
path: root/net/src
diff options
context:
space:
mode:
Diffstat (limited to 'net/src')
-rw-r--r--net/src/error.rs4
-rw-r--r--net/src/transports/tls.rs8
2 files changed, 6 insertions, 6 deletions
diff --git a/net/src/error.rs b/net/src/error.rs
index 0d96d64..be90a03 100644
--- a/net/src/error.rs
+++ b/net/src/error.rs
@@ -29,10 +29,10 @@ pub enum Error {
ChannelRecv(#[from] smol::channel::RecvError),
#[error("Tls Error: {0}")]
- Rustls(#[from] async_rustls::rustls::Error),
+ Rustls(#[from] futures_rustls::rustls::Error),
#[error("Invalid DNS Name: {0}")]
- InvalidDnsNameError(#[from] async_rustls::rustls::client::InvalidDnsNameError),
+ InvalidDnsNameError(#[from] futures_rustls::pki_types::InvalidDnsNameError),
#[error(transparent)]
KaryonCore(#[from] karyon_core::error::Error),
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<TlsConn> {
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<Box<dyn Connection>> {
match endpoint {
Endpoint::Tcp(..) | Endpoint::Tls(..) => {}