Struct ntex::server::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
impl SslContext
[src]
impl SslContext
[src]pub fn builder(method: SslMethod) -> Result<SslContextBuilder, ErrorStack>
[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]
pub fn new_ex_index<T>() -> Result<Index<SslContext, T>, ErrorStack> where
T: 'static + Sync + Send,
[src]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 certificate(&self) -> Option<&X509Ref>
[src]
pub fn certificate(&self) -> Option<&X509Ref>
[src]Returns the certificate associated with this SslContext
, if present.
Requires OpenSSL 1.0.2 or newer.
This corresponds to SSL_CTX_get0_certificate
.
pub fn private_key(&self) -> Option<&PKeyRef<Private>>
[src]
pub fn private_key(&self) -> Option<&PKeyRef<Private>>
[src]Returns the private key associated with this SslContext
, if present.
Requires OpenSSL 1.0.2 or newer.
This corresponds to SSL_CTX_get0_privatekey
.
pub fn cert_store(&self) -> &X509StoreRef
[src]
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]
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]
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 fn max_early_data(&self) -> u32
[src]
pub fn max_early_data(&self) -> u32
[src]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
.
pub unsafe fn add_session(&self, session: &SslSessionRef) -> bool
[src]
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]
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]
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
.
pub fn verify_mode(&self) -> SslVerifyMode
[src]
pub fn verify_mode(&self) -> SslVerifyMode
[src]Returns the verify mode that was set on this context from SslContextBuilder::set_verify
.
This corresponds to SSL_CTX_get_verify_mode
.
Trait Implementations
impl AsRef<SslContextRef> for SslContext
[src]
impl AsRef<SslContextRef> for SslContext
[src]pub fn as_ref(&self) -> &SslContextRef
[src]
pub fn as_ref(&self) -> &SslContextRef
[src]Performs the conversion.
impl Borrow<SslContextRef> for SslContext
[src]
impl Borrow<SslContextRef> for SslContext
[src]pub fn borrow(&self) -> &SslContextRef
[src]
pub fn borrow(&self) -> &SslContextRef
[src]Immutably borrows from an owned value. Read more
impl Clone for SslContext
[src]
impl Clone for SslContext
[src]pub fn clone(&self) -> SslContext
[src]
pub fn clone(&self) -> SslContext
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for SslContext
[src]
impl Debug for SslContext
[src]impl Deref for SslContext
[src]
impl Deref for SslContext
[src]type Target = SslContextRef
type Target = SslContextRef
The resulting type after dereferencing.
pub fn deref(&self) -> &SslContextRef
[src]
pub fn deref(&self) -> &SslContextRef
[src]Dereferences the value.
impl DerefMut for SslContext
[src]
impl DerefMut for SslContext
[src]pub fn deref_mut(&mut self) -> &mut SslContextRef
[src]
pub fn deref_mut(&mut self) -> &mut SslContextRef
[src]Mutably dereferences the value.
impl Drop for SslContext
[src]
impl Drop for SslContext
[src]impl ForeignType for SslContext
[src]
impl ForeignType for SslContext
[src]type Ref = SslContextRef
type Ref = SslContextRef
The type representing a reference to this type.
pub unsafe fn from_ptr(ptr: *mut SSL_CTX) -> SslContext
[src]
pub unsafe fn from_ptr(ptr: *mut SSL_CTX) -> SslContext
[src]Constructs an instance of this type from its raw type.
impl Send for SslContext
[src]
impl Sync for SslContext
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more