Skip to content

Commit

Permalink
chore(tls): fix feature flagging of DEFAULT_TLS_HANDSHAKE_TIMEOUT
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Dec 16, 2023
1 parent 02ac0bb commit c5b2d0c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions actix-tls/src/accept/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
6 changes: 3 additions & 3 deletions actix-tls/src/accept/rustls_0_20.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -92,13 +92,13 @@ impl<IO: ActixStream> ActixStream for TlsStream<IO> {

/// Accept TLS connections via the `rustls` crate.
pub struct Acceptor {
config: Arc<ServerConfig>,
config: Arc<reexports::ServerConfig>,
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,
Expand Down
6 changes: 3 additions & 3 deletions actix-tls/src/accept/rustls_0_21.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -92,13 +92,13 @@ impl<IO: ActixStream> ActixStream for TlsStream<IO> {

/// Accept TLS connections via the `rustls` crate.
pub struct Acceptor {
config: Arc<ServerConfig>,
config: Arc<reexports::ServerConfig>,
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,
Expand Down

0 comments on commit c5b2d0c

Please sign in to comment.