Struct SslConnector
pub struct SslConnector(/* private fields */);
Expand description
A type which wraps client-side streams in a TLS session.
OpenSSL’s default configuration is highly insecure. This connector manages the OpenSSL structures, configuring cipher suites, session options, hostname verification, and more.
OpenSSL’s built in hostname verification is used when linking against OpenSSL 1.0.2 or 1.1.0, and a custom implementation is used when linking against OpenSSL 1.0.1.
Implementations§
§impl SslConnector
impl SslConnector
pub fn builder(method: SslMethod) -> Result<SslConnectorBuilder, ErrorStack>
pub fn builder(method: SslMethod) -> Result<SslConnectorBuilder, ErrorStack>
Creates a new builder for TLS connections.
The default configuration is subject to change, and is currently derived from Python.
pub fn setup_connect<S>(
&self,
domain: &str,
stream: S,
) -> Result<MidHandshakeSslStream<S>, ErrorStack>
pub fn setup_connect<S>( &self, domain: &str, stream: S, ) -> Result<MidHandshakeSslStream<S>, ErrorStack>
Initiates a client-side TLS session on a stream.
The domain is used for SNI and hostname verification.
pub fn connect<S>(
&self,
domain: &str,
stream: S,
) -> Result<SslStream<S>, HandshakeError<S>>
pub fn connect<S>( &self, domain: &str, stream: S, ) -> Result<SslStream<S>, HandshakeError<S>>
Attempts a client-side TLS session on a stream.
The domain is used for SNI (if it is not an IP address) and hostname verification if enabled.
This is a convenience method which combines Self::setup_connect
and
MidHandshakeSslStream::handshake
.
pub fn configure(&self) -> Result<ConnectConfiguration, ErrorStack>
pub fn configure(&self) -> Result<ConnectConfiguration, ErrorStack>
Returns a structure allowing for configuration of a single TLS session before connection.
pub fn into_context(self) -> SslContext
pub fn into_context(self) -> SslContext
Consumes the SslConnector
, returning the inner raw SslContext
.
pub fn context(&self) -> &SslContextRef
pub fn context(&self) -> &SslContextRef
Returns a shared reference to the inner raw SslContext
.
Trait Implementations§
§impl Clone for SslConnector
impl Clone for SslConnector
§fn clone(&self) -> SslConnector
fn clone(&self) -> SslConnector
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for SslConnector
impl RefUnwindSafe for SslConnector
impl Send for SslConnector
impl Sync for SslConnector
impl Unpin for SslConnector
impl UnwindSafe for SslConnector
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more