Struct openssl::ssl::SslContext [−][src]
pub struct SslContext(_);
Expand description
A context object for TLS streams.
Applications commonly configure a single SslContext
that is shared by all of its
SslStreams
.
Implementations
Creates a new builder object for an SslContext
.
pub fn new_ex_index<T>() -> Result<Index<SslContext, T>, ErrorStack> where
T: 'static + Sync + Send,
pub fn new_ex_index<T>() -> Result<Index<SslContext, T>, ErrorStack> where
T: 'static + Sync + Send,
Returns a new extra data index.
Each invocation of this function is guaranteed to return a distinct index. These can be used to store data in the context that can be retrieved later by callbacks, for example.
This corresponds to SSL_CTX_get_ex_new_index
.
Methods from Deref<Target = SslContextRef>
Returns the certificate associated with this SslContext
, if present.
Requires OpenSSL 1.0.2 or newer.
This corresponds to SSL_CTX_get0_certificate
.
Returns the private key associated with this SslContext
, if present.
Requires OpenSSL 1.0.2 or newer.
This corresponds to SSL_CTX_get0_privatekey
.
Returns a shared reference to the certificate store used for verification.
This corresponds to SSL_CTX_get_cert_store
.
Returns a shared reference to the stack of certificates making up the chain from the leaf.
This corresponds to SSL_CTX_get_extra_chain_certs
.
Returns a reference to the extra data at the specified index.
This corresponds to SSL_CTX_get_ex_data
.
Gets the maximum amount of early data that will be accepted on incoming connections.
Requires OpenSSL 1.1.1 or newer.
This corresponds to SSL_CTX_get_max_early_data
.
Adds a session to the context’s cache.
Returns true
if the session was successfully added to the cache, and false
if it was already present.
This corresponds to SSL_CTX_add_session
.
Safety
The caller of this method is responsible for ensuring that the session has never been used with another
SslContext
than this one.
Removes a session from the context’s cache and marks it as non-resumable.
Returns true
if the session was successfully found and removed, and false
otherwise.
This corresponds to SSL_CTX_remove_session
.
Safety
The caller of this method is responsible for ensuring that the session has never been used with another
SslContext
than this one.
Returns the context’s session cache size limit.
A value of 0 means that the cache size is unbounded.
This corresponds to SSL_CTX_sess_get_cache_size
.
Returns the verify mode that was set on this context from SslContextBuilder::set_verify
.
This corresponds to SSL_CTX_get_verify_mode
.
Trait Implementations
Performs the conversion.
Immutably borrows from an owned value. Read more
type Target = SslContextRef
type Target = SslContextRef
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.
Auto Trait Implementations
Blanket Implementations
Mutably borrows from an owned value. Read more