mirror of https://github.com/fafhrd91/actix-net
re-export async tls streams with async prefix
This commit is contained in:
parent
4b35c052ef
commit
bd5d971dde
|
@ -11,7 +11,7 @@ use futures_core::future::LocalBoxFuture;
|
|||
use log::trace;
|
||||
use tokio_native_tls::{
|
||||
native_tls::TlsConnector as NativeTlsConnector, TlsConnector as AsyncNativeTlsConnector,
|
||||
TlsStream,
|
||||
TlsStream as AsyncTlsStream,
|
||||
};
|
||||
|
||||
use crate::connect::{Connection, Host};
|
||||
|
@ -45,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;
|
||||
|
@ -64,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>>;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ use actix_utils::future::{ok, Ready};
|
|||
use futures_core::ready;
|
||||
use log::trace;
|
||||
use openssl::ssl::SslConnector;
|
||||
use tokio_openssl::SslStream;
|
||||
use tokio_openssl::SslStream as AsyncSslStream;
|
||||
|
||||
use crate::connect::{Connection, Host};
|
||||
|
||||
|
@ -57,7 +57,7 @@ where
|
|||
R: Host,
|
||||
IO: ActixStream + 'static,
|
||||
{
|
||||
type Response = Connection<R, SslStream<IO>>;
|
||||
type Response = Connection<R, AsyncSslStream<IO>>;
|
||||
type Error = io::Error;
|
||||
type Config = ();
|
||||
type Service = TlsConnectorService;
|
||||
|
@ -89,7 +89,7 @@ where
|
|||
R: Host,
|
||||
IO: ActixStream,
|
||||
{
|
||||
type Response = Connection<R, SslStream<IO>>;
|
||||
type Response = Connection<R, AsyncSslStream<IO>>;
|
||||
type Error = io::Error;
|
||||
type Future = ConnectFut<R, IO>;
|
||||
|
||||
|
@ -110,7 +110,7 @@ where
|
|||
.expect("SSL connect configuration was invalid.");
|
||||
|
||||
ConnectFut {
|
||||
io: Some(SslStream::new(ssl, io).unwrap()),
|
||||
io: Some(AsyncSslStream::new(ssl, io).unwrap()),
|
||||
stream: Some(stream),
|
||||
}
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ where
|
|||
/// Connect future for OpenSSL service.
|
||||
#[doc(hidden)]
|
||||
pub struct ConnectFut<R, IO> {
|
||||
io: Option<SslStream<IO>>,
|
||||
io: Option<AsyncSslStream<IO>>,
|
||||
stream: Option<Connection<R, ()>>,
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ where
|
|||
R: Host,
|
||||
IO: ActixStream,
|
||||
{
|
||||
type Output = Result<Connection<R, SslStream<IO>>, io::Error>;
|
||||
type Output = Result<Connection<R, AsyncSslStream<IO>>, io::Error>;
|
||||
|
||||
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||
let this = self.get_mut();
|
||||
|
|
|
@ -17,7 +17,7 @@ use actix_utils::future::{ok, Ready};
|
|||
use futures_core::ready;
|
||||
use log::trace;
|
||||
use tokio_rustls::rustls::{client::ServerName, OwnedTrustAnchor, RootCertStore};
|
||||
use tokio_rustls::{client::TlsStream, rustls::ClientConfig};
|
||||
use tokio_rustls::{client::TlsStream as AsyncTlsStream, rustls::ClientConfig};
|
||||
use tokio_rustls::{Connect as RustlsConnect, TlsConnector as RustlsTlsConnector};
|
||||
use webpki_roots::TLS_SERVER_ROOTS;
|
||||
|
||||
|
@ -71,7 +71,7 @@ where
|
|||
R: Host,
|
||||
IO: ActixStream + 'static,
|
||||
{
|
||||
type Response = Connection<R, TlsStream<IO>>;
|
||||
type Response = Connection<R, AsyncTlsStream<IO>>;
|
||||
type Error = io::Error;
|
||||
type Config = ();
|
||||
type Service = TlsConnectorService;
|
||||
|
@ -96,7 +96,7 @@ where
|
|||
R: Host,
|
||||
IO: ActixStream,
|
||||
{
|
||||
type Response = Connection<R, TlsStream<IO>>;
|
||||
type Response = Connection<R, AsyncTlsStream<IO>>;
|
||||
type Error = io::Error;
|
||||
type Future = ConnectFut<R, IO>;
|
||||
|
||||
|
@ -132,7 +132,7 @@ where
|
|||
R: Host,
|
||||
IO: ActixStream,
|
||||
{
|
||||
type Output = Result<Connection<R, TlsStream<IO>>, io::Error>;
|
||||
type Output = Result<Connection<R, AsyncTlsStream<IO>>, io::Error>;
|
||||
|
||||
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||
match self.get_mut() {
|
||||
|
|
Loading…
Reference in New Issue