Struct openssl::ssl::SslContext [−]
pub struct 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]
impl SslContext
pub fn builder(method: SslMethod) -> Result<SslContextBuilder, ErrorStack>
[src]
pub fn builder(method: SslMethod) -> Result<SslContextBuilder, ErrorStack>
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,
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>
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>>
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
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>
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>
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
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
.
Trait Implementations
impl ForeignType for SslContext
impl ForeignType for SslContext
type CType = SSL_CTX
The raw C type.
type Ref = SslContextRef
The type representing a reference to this type.
unsafe fn from_ptr(ptr: *mut SSL_CTX) -> SslContext
unsafe fn from_ptr(ptr: *mut SSL_CTX) -> SslContext
Constructs an instance of this type from its raw type.
fn as_ptr(&self) -> *mut SSL_CTX
fn as_ptr(&self) -> *mut SSL_CTX
Returns a raw pointer to the wrapped value.
impl Drop for SslContext
impl Drop for SslContext
impl Deref for SslContext
impl Deref for SslContext
type Target = SslContextRef
The resulting type after dereferencing.
fn deref(&self) -> &SslContextRef
fn deref(&self) -> &SslContextRef
Dereferences the value.
impl DerefMut for SslContext
impl DerefMut for SslContext
fn deref_mut(&mut self) -> &mut SslContextRef
fn deref_mut(&mut self) -> &mut SslContextRef
Mutably dereferences the value.
impl Borrow<SslContextRef> for SslContext
impl Borrow<SslContextRef> for SslContext
fn borrow(&self) -> &SslContextRef
fn borrow(&self) -> &SslContextRef
Immutably borrows from an owned value. Read more
impl AsRef<SslContextRef> for SslContext
impl AsRef<SslContextRef> for SslContext
fn as_ref(&self) -> &SslContextRef
fn as_ref(&self) -> &SslContextRef
Performs the conversion.
impl Send for SslContext
[src]
impl Send for SslContext
impl Sync for SslContext
[src]
impl Sync for SslContext
impl Clone for SslContext
[src]
impl Clone for SslContext
fn clone(&self) -> Self
[src]
fn clone(&self) -> Self
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)
Performs copy-assignment from source
. Read more
impl Debug for SslContext
[src]
impl Debug for SslContext