[−]Struct openssl::ssl::SslContext
A context object for TLS streams.
Applications commonly configure a single SslContext
that is shared by all of its
SslStreams
.
Methods
impl SslContext
[src][−]
pub fn builder(method: SslMethod) -> Result<SslContextBuilder, ErrorStack>
[src][−]
Creates a new builder object for an SslContext
.
pub fn new_ex_index<T>() -> Result<Index<SslContext, T>, ErrorStack> where
T: 'static + Sync + Send,
[src][−]
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>
pub fn cert_store(&self) -> &X509StoreRef
[src][−]
Returns a shared reference to the certificate store used for verification.
This corresponds to SSL_CTX_get_cert_store
.
pub fn extra_chain_certs(&self) -> &StackRef<X509>
[src][−]
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
.
pub fn ex_data<T>(&self, index: Index<SslContext, T>) -> Option<&T>
[src][−]
Returns a reference to the extra data at the specified index.
This corresponds to SSL_CTX_get_ex_data
.
pub unsafe fn add_session(&self, session: &SslSessionRef) -> bool
[src][−]
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.
pub unsafe fn remove_session(&self, session: &SslSessionRef) -> bool
[src][−]
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.
pub fn session_cache_size(&self) -> i64
[src][−]
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
.
Trait Implementations
impl Sync for SslContext
[src]
impl AsRef<SslContextRef> for SslContext
[+]
impl Clone for SslContext
[src][+]
impl Send for SslContext
[src]
impl Drop for SslContext
[+]
impl Debug for SslContext
[src][+]
impl DerefMut for SslContext
[+]
impl Deref for SslContext
[+]
impl Borrow<SslContextRef> for SslContext
[+]
impl ForeignType for SslContext
[+]
Blanket Implementations
impl<T> From for T
[src][−]
impl<T, U> Into for T where
U: From<T>,
[src][−]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src][−]
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>,
[src][−]
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src][−]
impl<T> Borrow for T where
T: ?Sized,
[src][−]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src][−]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src][−]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src][−]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src][−]
impl<T> Any for T where
T: 'static + ?Sized,
[src][−]
T: 'static + ?Sized,