pub struct SslContextRef(/* private fields */);Expand description
Reference to 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.
Requires OpenSSL 1.0.2 or LibreSSL 2.7.0 or newer.
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.
Requires OpenSSL 1.0.2 or LibreSSL 3.4.0 or newer.
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 fn max_early_data(&self) -> u32
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 LibreSSL 3.4.0 or newer.
This corresponds to SSL_CTX_get_max_early_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) -> i64
pub fn session_cache_size(&self) -> i64
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.
Sourcepub fn num_tickets(&self) -> usize
pub fn num_tickets(&self) -> usize
Gets the number of TLS 1.3 session tickets that will be sent to a client after a full handshake.
Requires OpenSSL 1.1.1 or newer.
This corresponds to SSL_CTX_get_num_tickets.
Sourcepub fn security_level(&self) -> u32
pub fn security_level(&self) -> u32
Get the context’s security level, which controls the allowed parameters and algorithms.
Requires OpenSSL 1.1.0 or newer.
This corresponds to SSL_CTX_get_security_level.
Trait Implementations§
Source§impl AsRef<SslContextRef> for SslContext
impl AsRef<SslContextRef> for SslContext
Source§fn as_ref(&self) -> &SslContextRef
fn as_ref(&self) -> &SslContextRef
Source§impl Borrow<SslContextRef> for SslContext
impl Borrow<SslContextRef> for SslContext
Source§fn borrow(&self) -> &SslContextRef
fn borrow(&self) -> &SslContextRef
Source§impl ForeignTypeRef for SslContextRef
impl ForeignTypeRef for SslContextRef
Source§impl ToOwned for SslContextRef
impl ToOwned for SslContextRef
Source§type Owned = SslContext
type Owned = SslContext
Source§fn to_owned(&self) -> <SslContextRef as ToOwned>::Owned
fn to_owned(&self) -> <SslContextRef as ToOwned>::Owned
1.63.0 · Source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
impl Send for SslContextRef
impl Sync for SslContextRef
Auto Trait Implementations§
impl !Freeze for SslContextRef
impl !RefUnwindSafe for SslContextRef
impl Unpin for SslContextRef
impl UnwindSafe for SslContextRef
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.