Loading WANT_FROM_OTHER_CRATES +1 −2 Original line number Diff line number Diff line Loading @@ -71,7 +71,6 @@ pem: (see arti#146 for discussion) tls-api: * Async support * Support for disabling certificate & hostname verification * Support for disabling certificate verification * Support for getting certificate (or does it have it?) * Support for RFC5705 exporters crates/tor-rtcompat/src/async_std.rs +2 −3 Original line number Diff line number Diff line Loading @@ -7,7 +7,6 @@ use std::io::Result as IoResult; use crate::impls::native_tls::NativeTlsProvider; #[cfg(feature = "rustls")] use crate::impls::rustls::RustlsProvider; use async_std_crate::net::TcpStream; use async_executors::AsyncStd; Loading Loading @@ -36,7 +35,7 @@ pub struct AsyncStdNativeTlsRuntime { /// Implementation type for AsyncStdRuntime. #[cfg(all(feature = "native-tls"))] type NativeTlsInner = CompoundRuntime<AsyncStd, AsyncStd, AsyncStd, NativeTlsProvider<TcpStream>>; type NativeTlsInner = CompoundRuntime<AsyncStd, AsyncStd, AsyncStd, NativeTlsProvider>; #[cfg(all(feature = "native-tls"))] crate::opaque::implement_opaque_runtime! { Loading @@ -53,7 +52,7 @@ pub struct AsyncStdRustlsRuntime { /// Implementation type for AsyncStdRustlsRuntime. #[cfg(feature = "rustls")] type RustlsInner = CompoundRuntime<AsyncStd, AsyncStd, AsyncStd, RustlsProvider<TcpStream>>; type RustlsInner = CompoundRuntime<AsyncStd, AsyncStd, AsyncStd, RustlsProvider>; #[cfg(feature = "rustls")] crate::opaque::implement_opaque_runtime! { Loading crates/tor-rtcompat/src/compound.rs +2 −3 Original line number Diff line number Diff line Loading @@ -118,11 +118,10 @@ where } } impl<SpawnR, SleepR, TcpR, TlsR> TlsProvider<TcpR::TcpStream> for CompoundRuntime<SpawnR, SleepR, TcpR, TlsR> impl<SpawnR, SleepR, TcpR, TlsR, S> TlsProvider<S> for CompoundRuntime<SpawnR, SleepR, TcpR, TlsR> where TcpR: TcpProvider, TlsR: TlsProvider<TcpR::TcpStream>, TlsR: TlsProvider<S>, { type Connector = TlsR::Connector; type TlsStream = TlsR::TlsStream; Loading crates/tor-rtcompat/src/impls/native_tls.rs +5 −10 Original line number Diff line number Diff line Loading @@ -14,10 +14,7 @@ use std::{ /// /// It supports wrapping any reasonable stream type that implements `AsyncRead` + `AsyncWrite`. #[non_exhaustive] pub struct NativeTlsProvider<S> { /// Phantom data to ensure proper variance. _phantom: std::marker::PhantomData<fn(S) -> S>, } pub struct NativeTlsProvider {} impl<S> CertifiedConn for async_native_tls::TlsStream<S> where Loading Loading @@ -63,7 +60,7 @@ where } } impl<S> TlsProvider<S> for NativeTlsProvider<S> impl<S> TlsProvider<S> for NativeTlsProvider where S: AsyncRead + AsyncWrite + Unpin + Send + 'static, { Loading @@ -90,16 +87,14 @@ where } } impl<S> NativeTlsProvider<S> { impl NativeTlsProvider { /// Construct a new [`NativeTlsProvider`.] pub(crate) fn new() -> Self { NativeTlsProvider { _phantom: std::marker::PhantomData, } NativeTlsProvider {} } } impl<S> Default for NativeTlsProvider<S> { impl Default for NativeTlsProvider { fn default() -> Self { Self::new() } Loading crates/tor-rtcompat/src/impls/rustls.rs +4 −7 Original line number Diff line number Diff line Loading @@ -16,11 +16,9 @@ use std::{ /// /// It supports wrapping any reasonable stream type that implements `AsyncRead` + `AsyncWrite`. #[non_exhaustive] pub struct RustlsProvider<S> { pub struct RustlsProvider { /// Inner `ClientConfig` logic used to create connectors. config: Arc<async_rustls::rustls::ClientConfig>, /// Phantom data to ensure proper variance. _phantom: std::marker::PhantomData<fn(S) -> S>, } impl<S> CertifiedConn for async_rustls::client::TlsStream<S> { Loading Loading @@ -53,7 +51,7 @@ where } } impl<S> TlsProvider<S> for RustlsProvider<S> impl<S> TlsProvider<S> for RustlsProvider where S: AsyncRead + AsyncWrite + Unpin + Send + 'static, { Loading @@ -70,7 +68,7 @@ where } } impl<S> RustlsProvider<S> { impl RustlsProvider { /// Construct a new [`RustlsProvider`.] pub(crate) fn new() -> Self { let mut config = async_rustls::rustls::ClientConfig::new(); Loading @@ -89,12 +87,11 @@ impl<S> RustlsProvider<S> { RustlsProvider { config: Arc::new(config), _phantom: std::marker::PhantomData, } } } impl<S> Default for RustlsProvider<S> { impl Default for RustlsProvider { fn default() -> Self { Self::new() } Loading Loading
WANT_FROM_OTHER_CRATES +1 −2 Original line number Diff line number Diff line Loading @@ -71,7 +71,6 @@ pem: (see arti#146 for discussion) tls-api: * Async support * Support for disabling certificate & hostname verification * Support for disabling certificate verification * Support for getting certificate (or does it have it?) * Support for RFC5705 exporters
crates/tor-rtcompat/src/async_std.rs +2 −3 Original line number Diff line number Diff line Loading @@ -7,7 +7,6 @@ use std::io::Result as IoResult; use crate::impls::native_tls::NativeTlsProvider; #[cfg(feature = "rustls")] use crate::impls::rustls::RustlsProvider; use async_std_crate::net::TcpStream; use async_executors::AsyncStd; Loading Loading @@ -36,7 +35,7 @@ pub struct AsyncStdNativeTlsRuntime { /// Implementation type for AsyncStdRuntime. #[cfg(all(feature = "native-tls"))] type NativeTlsInner = CompoundRuntime<AsyncStd, AsyncStd, AsyncStd, NativeTlsProvider<TcpStream>>; type NativeTlsInner = CompoundRuntime<AsyncStd, AsyncStd, AsyncStd, NativeTlsProvider>; #[cfg(all(feature = "native-tls"))] crate::opaque::implement_opaque_runtime! { Loading @@ -53,7 +52,7 @@ pub struct AsyncStdRustlsRuntime { /// Implementation type for AsyncStdRustlsRuntime. #[cfg(feature = "rustls")] type RustlsInner = CompoundRuntime<AsyncStd, AsyncStd, AsyncStd, RustlsProvider<TcpStream>>; type RustlsInner = CompoundRuntime<AsyncStd, AsyncStd, AsyncStd, RustlsProvider>; #[cfg(feature = "rustls")] crate::opaque::implement_opaque_runtime! { Loading
crates/tor-rtcompat/src/compound.rs +2 −3 Original line number Diff line number Diff line Loading @@ -118,11 +118,10 @@ where } } impl<SpawnR, SleepR, TcpR, TlsR> TlsProvider<TcpR::TcpStream> for CompoundRuntime<SpawnR, SleepR, TcpR, TlsR> impl<SpawnR, SleepR, TcpR, TlsR, S> TlsProvider<S> for CompoundRuntime<SpawnR, SleepR, TcpR, TlsR> where TcpR: TcpProvider, TlsR: TlsProvider<TcpR::TcpStream>, TlsR: TlsProvider<S>, { type Connector = TlsR::Connector; type TlsStream = TlsR::TlsStream; Loading
crates/tor-rtcompat/src/impls/native_tls.rs +5 −10 Original line number Diff line number Diff line Loading @@ -14,10 +14,7 @@ use std::{ /// /// It supports wrapping any reasonable stream type that implements `AsyncRead` + `AsyncWrite`. #[non_exhaustive] pub struct NativeTlsProvider<S> { /// Phantom data to ensure proper variance. _phantom: std::marker::PhantomData<fn(S) -> S>, } pub struct NativeTlsProvider {} impl<S> CertifiedConn for async_native_tls::TlsStream<S> where Loading Loading @@ -63,7 +60,7 @@ where } } impl<S> TlsProvider<S> for NativeTlsProvider<S> impl<S> TlsProvider<S> for NativeTlsProvider where S: AsyncRead + AsyncWrite + Unpin + Send + 'static, { Loading @@ -90,16 +87,14 @@ where } } impl<S> NativeTlsProvider<S> { impl NativeTlsProvider { /// Construct a new [`NativeTlsProvider`.] pub(crate) fn new() -> Self { NativeTlsProvider { _phantom: std::marker::PhantomData, } NativeTlsProvider {} } } impl<S> Default for NativeTlsProvider<S> { impl Default for NativeTlsProvider { fn default() -> Self { Self::new() } Loading
crates/tor-rtcompat/src/impls/rustls.rs +4 −7 Original line number Diff line number Diff line Loading @@ -16,11 +16,9 @@ use std::{ /// /// It supports wrapping any reasonable stream type that implements `AsyncRead` + `AsyncWrite`. #[non_exhaustive] pub struct RustlsProvider<S> { pub struct RustlsProvider { /// Inner `ClientConfig` logic used to create connectors. config: Arc<async_rustls::rustls::ClientConfig>, /// Phantom data to ensure proper variance. _phantom: std::marker::PhantomData<fn(S) -> S>, } impl<S> CertifiedConn for async_rustls::client::TlsStream<S> { Loading Loading @@ -53,7 +51,7 @@ where } } impl<S> TlsProvider<S> for RustlsProvider<S> impl<S> TlsProvider<S> for RustlsProvider where S: AsyncRead + AsyncWrite + Unpin + Send + 'static, { Loading @@ -70,7 +68,7 @@ where } } impl<S> RustlsProvider<S> { impl RustlsProvider { /// Construct a new [`RustlsProvider`.] pub(crate) fn new() -> Self { let mut config = async_rustls::rustls::ClientConfig::new(); Loading @@ -89,12 +87,11 @@ impl<S> RustlsProvider<S> { RustlsProvider { config: Arc::new(config), _phantom: std::marker::PhantomData, } } } impl<S> Default for RustlsProvider<S> { impl Default for RustlsProvider { fn default() -> Self { Self::new() } Loading