mirror of
https://github.com/fafhrd91/actix-net
synced 2025-08-22 21:15:06 +02:00
prepare actix-tls release 3.0.0-rc.1 (#423)
This commit is contained in:
@@ -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,
|
||||
TlsStream,
|
||||
native_tls::TlsConnector as NativeTlsConnector, TlsConnector as AsyncNativeTlsConnector,
|
||||
TlsStream as AsyncTlsStream,
|
||||
};
|
||||
|
||||
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),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,7 +45,7 @@ impl<R: Host, IO> ServiceFactory<Connection<R, IO>> for TlsConnector
|
||||
where
|
||||
IO: ActixStream + 'static,
|
||||
{
|
||||
type Response = Connection<R, TlsStream<IO>>;
|
||||
type Response = Connection<R, AsyncTlsStream<IO>>;
|
||||
type Error = io::Error;
|
||||
type Config = ();
|
||||
type Service = Self;
|
||||
@@ -62,7 +64,7 @@ where
|
||||
R: Host,
|
||||
IO: ActixStream + 'static,
|
||||
{
|
||||
type Response = Connection<R, TlsStream<IO>>;
|
||||
type Response = Connection<R, AsyncTlsStream<IO>>;
|
||||
type Error = io::Error;
|
||||
type Future = LocalBoxFuture<'static, Result<Self::Response, Self::Error>>;
|
||||
|
||||
|
Reference in New Issue
Block a user