diff --git a/actix-tls/src/accept/mod.rs b/actix-tls/src/accept/mod.rs index 8d89f006..e884bd33 100644 --- a/actix-tls/src/accept/mod.rs +++ b/actix-tls/src/accept/mod.rs @@ -37,6 +37,8 @@ pub(crate) static MAX_CONN: AtomicUsize = AtomicUsize::new(256); feature = "openssl", feature = "rustls-0_20", feature = "rustls-0_21", + feature = "rustls-0_22-webpki-roots", + feature = "rustls-0_22-native-roots", feature = "native-tls", ))] pub(crate) const DEFAULT_TLS_HANDSHAKE_TIMEOUT: std::time::Duration = diff --git a/actix-tls/src/accept/rustls_0_20.rs b/actix-tls/src/accept/rustls_0_20.rs index d06f1799..f8c9206c 100644 --- a/actix-tls/src/accept/rustls_0_20.rs +++ b/actix-tls/src/accept/rustls_0_20.rs @@ -23,7 +23,7 @@ use actix_utils::{ }; use pin_project_lite::pin_project; use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; -use tokio_rustls::{rustls::ServerConfig, Accept, TlsAcceptor}; +use tokio_rustls::{Accept, TlsAcceptor}; use tokio_rustls_023 as tokio_rustls; use super::{TlsError, DEFAULT_TLS_HANDSHAKE_TIMEOUT, MAX_CONN_COUNTER}; @@ -92,13 +92,13 @@ impl ActixStream for TlsStream { /// Accept TLS connections via the `rustls` crate. pub struct Acceptor { - config: Arc, + config: Arc, handshake_timeout: Duration, } impl Acceptor { /// Constructs `rustls` based acceptor service factory. - pub fn new(config: ServerConfig) -> Self { + pub fn new(config: reexports::ServerConfig) -> Self { Acceptor { config: Arc::new(config), handshake_timeout: DEFAULT_TLS_HANDSHAKE_TIMEOUT, diff --git a/actix-tls/src/accept/rustls_0_21.rs b/actix-tls/src/accept/rustls_0_21.rs index 27db8cdd..fcf6a693 100644 --- a/actix-tls/src/accept/rustls_0_21.rs +++ b/actix-tls/src/accept/rustls_0_21.rs @@ -23,7 +23,7 @@ use actix_utils::{ }; use pin_project_lite::pin_project; use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; -use tokio_rustls::{rustls::ServerConfig, Accept, TlsAcceptor}; +use tokio_rustls::{Accept, TlsAcceptor}; use tokio_rustls_024 as tokio_rustls; use super::{TlsError, DEFAULT_TLS_HANDSHAKE_TIMEOUT, MAX_CONN_COUNTER}; @@ -92,13 +92,13 @@ impl ActixStream for TlsStream { /// Accept TLS connections via the `rustls` crate. pub struct Acceptor { - config: Arc, + config: Arc, handshake_timeout: Duration, } impl Acceptor { /// Constructs `rustls` based acceptor service factory. - pub fn new(config: ServerConfig) -> Self { + pub fn new(config: reexports::ServerConfig) -> Self { Acceptor { config: Arc::new(config), handshake_timeout: DEFAULT_TLS_HANDSHAKE_TIMEOUT,