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
sourceimpl 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
sourceimpl Clone for SslConnector
impl Clone for SslConnector
sourcefn clone(&self) -> SslConnector
fn clone(&self) -> SslConnector
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for SslConnector
impl Send for SslConnector
impl Sync for SslConnector
impl Unpin for SslConnector
impl UnwindSafe for SslConnector
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more