mirror of https://github.com/fafhrd91/actix-net
				
				
				
			tweak re-exports
This commit is contained in:
		
							parent
							
								
									af92550573
								
							
						
					
					
						commit
						4b35c052ef
					
				|  | @ -93,7 +93,7 @@ pub struct Acceptor { | |||
| } | ||||
| 
 | ||||
| impl Acceptor { | ||||
|     /// Constructs `native-tls` based `Acceptor` service factory.
 | ||||
|     /// Constructs `native-tls` based acceptor service factory.
 | ||||
|     pub fn new(acceptor: TlsAcceptor) -> Self { | ||||
|         Acceptor { | ||||
|             acceptor, | ||||
|  |  | |||
|  | @ -96,7 +96,7 @@ pub struct Acceptor { | |||
| } | ||||
| 
 | ||||
| impl Acceptor { | ||||
|     /// Create OpenSSL based `Acceptor` service factory.
 | ||||
|     /// Create `openssl` based acceptor service factory.
 | ||||
|     #[inline] | ||||
|     pub fn new(acceptor: SslAcceptor) -> Self { | ||||
|         Acceptor { | ||||
|  |  | |||
|  | @ -96,7 +96,7 @@ pub struct Acceptor { | |||
| } | ||||
| 
 | ||||
| impl Acceptor { | ||||
|     /// Constructs Rustls based acceptor service factory.
 | ||||
|     /// Constructs `rustls` based acceptor service factory.
 | ||||
|     pub fn new(config: ServerConfig) -> Self { | ||||
|         Acceptor { | ||||
|             config: Arc::new(config), | ||||
|  |  | |||
|  | @ -10,22 +10,24 @@ use actix_utils::future::{ok, Ready}; | |||
| use futures_core::future::LocalBoxFuture; | ||||
| use log::trace; | ||||
| use tokio_native_tls::{ | ||||
|     native_tls::TlsConnector as NativeTlsConnector, TlsConnector as TokioNativeTlsConnector, | ||||
|     native_tls::TlsConnector as NativeTlsConnector, TlsConnector as AsyncNativeTlsConnector, | ||||
|     TlsStream, | ||||
| }; | ||||
| 
 | ||||
| use crate::connect::{Connection, Host}; | ||||
| 
 | ||||
| pub mod reexports { | ||||
|     //! Re-exports from `native-tls` that are useful for connectors.
 | ||||
|     //! Re-exports from `native-tls` and `tokio-native-tls` that are useful for connectors.
 | ||||
| 
 | ||||
|     pub use tokio_native_tls::native_tls::TlsConnector; | ||||
| 
 | ||||
|     pub use tokio_native_tls::TlsStream as AsyncTlsStream; | ||||
| } | ||||
| 
 | ||||
| /// Connector service and factory using `native-tls`.
 | ||||
| #[derive(Clone)] | ||||
| pub struct TlsConnector { | ||||
|     connector: TokioNativeTlsConnector, | ||||
|     connector: AsyncNativeTlsConnector, | ||||
| } | ||||
| 
 | ||||
| impl TlsConnector { | ||||
|  | @ -34,7 +36,7 @@ impl TlsConnector { | |||
|     /// This type is it's own service factory, so it can be used in that setting, too.
 | ||||
|     pub fn new(connector: NativeTlsConnector) -> Self { | ||||
|         Self { | ||||
|             connector: TokioNativeTlsConnector::from(connector), | ||||
|             connector: AsyncNativeTlsConnector::from(connector), | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -20,9 +20,11 @@ use tokio_openssl::SslStream; | |||
| use crate::connect::{Connection, Host}; | ||||
| 
 | ||||
| pub mod reexports { | ||||
|     //! Re-exports from `openssl` that are useful for connectors.
 | ||||
|     //! Re-exports from `openssl` and `tokio-openssl` that are useful for connectors.
 | ||||
| 
 | ||||
|     pub use openssl::ssl::{Error as SslError, HandshakeError, SslConnector, SslMethod}; | ||||
|     pub use openssl::ssl::{Error, HandshakeError, SslConnector, SslMethod, SslStream}; | ||||
| 
 | ||||
|     pub use tokio_openssl::SslStream as AsyncSslStream; | ||||
| } | ||||
| 
 | ||||
| /// Connector service factory using `openssl`.
 | ||||
|  |  | |||
|  | @ -26,7 +26,9 @@ use crate::connect::{Connection, Host}; | |||
| pub mod reexports { | ||||
|     //! Re-exports from `rustls` and `webpki_roots` that are useful for connectors.
 | ||||
| 
 | ||||
|     pub use tokio_rustls::{client::TlsStream, rustls::ClientConfig}; | ||||
|     pub use tokio_rustls::rustls::ClientConfig; | ||||
| 
 | ||||
|     pub use tokio_rustls::client::TlsStream as AsyncTlsStream; | ||||
| 
 | ||||
|     pub use webpki_roots::TLS_SERVER_ROOTS; | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue