pub struct SslContextRef(/* private fields */);
Expand description
A borrowed reference to a SslContext
.
Implementations§
Source§impl SslContextRef
impl SslContextRef
Sourcepub fn certificate(&self) -> Option<&X509Ref>
pub fn certificate(&self) -> Option<&X509Ref>
Returns the certificate associated with this SslContext
, if present.
This corresponds to SSL_CTX_get0_certificate
.
Sourcepub fn private_key(&self) -> Option<&PKeyRef<Private>>
pub fn private_key(&self) -> Option<&PKeyRef<Private>>
Returns the private key associated with this SslContext
, if present.
This corresponds to SSL_CTX_get0_privatekey
.
Sourcepub fn cert_store(&self) -> &X509StoreRef
pub fn cert_store(&self) -> &X509StoreRef
Returns a shared reference to the certificate store used for verification.
This corresponds to SSL_CTX_get_cert_store
.
Sourcepub fn extra_chain_certs(&self) -> &StackRef<X509>
pub fn extra_chain_certs(&self) -> &StackRef<X509>
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
.
Sourcepub fn ex_data<T>(&self, index: Index<SslContext, T>) -> Option<&T>
pub fn ex_data<T>(&self, index: Index<SslContext, T>) -> Option<&T>
Returns a reference to the extra data at the specified index.
This corresponds to SSL_CTX_get_ex_data
.
Sourcepub unsafe fn add_session(&self, session: &SslSessionRef) -> bool
pub unsafe fn add_session(&self, session: &SslSessionRef) -> bool
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.
§Safety
The caller of this method is responsible for ensuring that the session has never been used with another
SslContext
than this one.
This corresponds to SSL_CTX_add_session
.
Sourcepub unsafe fn remove_session(&self, session: &SslSessionRef) -> bool
pub unsafe fn remove_session(&self, session: &SslSessionRef) -> bool
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.
§Safety
The caller of this method is responsible for ensuring that the session has never been used with another
SslContext
than this one.
This corresponds to SSL_CTX_remove_session
.
Sourcepub fn session_cache_size(&self) -> u64
pub fn session_cache_size(&self) -> u64
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
.
Sourcepub fn verify_mode(&self) -> SslVerifyMode
pub fn verify_mode(&self) -> SslVerifyMode
Returns the verify mode that was set on this context from SslContextBuilder::set_verify
.
This corresponds to SSL_CTX_get_verify_mode
.