From 2099629fe39ba3f6bdf38e90709a4aff10dba2e4 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Fri, 8 Mar 2019 22:41:30 -0800 Subject: [PATCH] cleanup ssl services --- actix-server/src/ssl/nativetls.rs | 7 ++----- actix-server/src/ssl/openssl.rs | 7 ++----- actix-server/src/ssl/rustls.rs | 7 ++----- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/actix-server/src/ssl/nativetls.rs b/actix-server/src/ssl/nativetls.rs index 4b86a9b8..f7108190 100644 --- a/actix-server/src/ssl/nativetls.rs +++ b/actix-server/src/ssl/nativetls.rs @@ -8,7 +8,6 @@ use tokio_io::{AsyncRead, AsyncWrite}; use crate::counter::{Counter, CounterGuard}; use crate::ssl::MAX_CONN_COUNTER; -use crate::ServerConfig; /// Support `SSL` connections via native-tls package /// @@ -37,16 +36,14 @@ impl Clone for NativeTlsAcceptor { } } -impl NewService for NativeTlsAcceptor { +impl NewService for NativeTlsAcceptor { type Response = TlsStream; type Error = Error; type Service = NativeTlsAcceptorService; type InitError = (); type Future = FutureResult; - fn new_service(&self, cfg: &ServerConfig) -> Self::Future { - cfg.set_secure(); - + fn new_service(&self, _: &()) -> Self::Future { MAX_CONN_COUNTER.with(|conns| { ok(NativeTlsAcceptorService { acceptor: self.acceptor.clone(), diff --git a/actix-server/src/ssl/openssl.rs b/actix-server/src/ssl/openssl.rs index 756e9eeb..3c71e17e 100644 --- a/actix-server/src/ssl/openssl.rs +++ b/actix-server/src/ssl/openssl.rs @@ -8,7 +8,6 @@ use tokio_openssl::{AcceptAsync, SslAcceptorExt, SslStream}; use crate::counter::{Counter, CounterGuard}; use crate::ssl::MAX_CONN_COUNTER; -use crate::ServerConfig; /// Support `SSL` connections via openssl package /// @@ -37,16 +36,14 @@ impl Clone for OpensslAcceptor { } } -impl NewService for OpensslAcceptor { +impl NewService for OpensslAcceptor { type Response = SslStream; type Error = HandshakeError; type Service = OpensslAcceptorService; type InitError = (); type Future = FutureResult; - fn new_service(&self, cfg: &ServerConfig) -> Self::Future { - cfg.set_secure(); - + fn new_service(&self, _: &()) -> Self::Future { MAX_CONN_COUNTER.with(|conns| { ok(OpensslAcceptorService { acceptor: self.acceptor.clone(), diff --git a/actix-server/src/ssl/rustls.rs b/actix-server/src/ssl/rustls.rs index f1ec30a2..2aec4e1f 100644 --- a/actix-server/src/ssl/rustls.rs +++ b/actix-server/src/ssl/rustls.rs @@ -10,7 +10,6 @@ use tokio_rustls::{Accept, TlsAcceptor, TlsStream}; use crate::counter::{Counter, CounterGuard}; use crate::ssl::MAX_CONN_COUNTER; -use crate::ServerConfig as SrvConfig; /// Support `SSL` connections via rustls package /// @@ -39,16 +38,14 @@ impl Clone for RustlsAcceptor { } } -impl NewService for RustlsAcceptor { +impl NewService for RustlsAcceptor { type Response = TlsStream; type Error = io::Error; type Service = RustlsAcceptorService; type InitError = (); type Future = FutureResult; - fn new_service(&self, cfg: &SrvConfig) -> Self::Future { - cfg.set_secure(); - + fn new_service(&self, _: &()) -> Self::Future { MAX_CONN_COUNTER.with(|conns| { ok(RustlsAcceptorService { acceptor: self.config.clone().into(),