Struct openssl::ssl::SslConnector
source · pub struct SslConnector(_);
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>>where
S: Read + Write,
pub fn connect<S>( &self, domain: &str, stream: S ) -> Result<SslStream<S>, HandshakeError<S>>where S: Read + Write,
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.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more