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§
source§impl SslConnector
impl SslConnector
sourcepub 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.
sourcepub 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>>
Initiates a client-side TLS session on a stream.
The domain is used for SNI and hostname verification.
sourcepub 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.
sourcepub fn into_context(self) -> SslContext
pub fn into_context(self) -> SslContext
Consumes the SslConnector
, returning the inner raw SslContext
.
sourcepub fn context(&self) -> &SslContextRef
pub fn context(&self) -> &SslContextRef
Returns a shared reference to the inner raw SslContext
.
Trait Implementations§
source§impl Clone for SslConnector
impl Clone for SslConnector
source§fn clone(&self) -> SslConnector
fn clone(&self) -> SslConnector
1.6.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§
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)