Struct openssl::ssl::SslOptions
source · [−]pub struct SslOptions { /* private fields */ }
Expand description
Options controlling the behavior of an SslContext
.
Implementations
sourceimpl SslOptions
impl SslOptions
sourcepub const DONT_INSERT_EMPTY_FRAGMENTS: SslOptions
pub const DONT_INSERT_EMPTY_FRAGMENTS: SslOptions
Disables a countermeasure against an SSLv3/TLSv1.0 vulnerability affecting CBC ciphers.
sourcepub const ALL: SslOptions
pub const ALL: SslOptions
A “reasonable default” set of options which enables compatibility flags.
sourcepub const NO_QUERY_MTU: SslOptions
pub const NO_QUERY_MTU: SslOptions
Do not query the MTU.
Only affects DTLS connections.
sourcepub const COOKIE_EXCHANGE: SslOptions
pub const COOKIE_EXCHANGE: SslOptions
Enables Cookie Exchange as described in RFC 4347 Section 4.2.1.
Only affects DTLS connections.
sourcepub const NO_TICKET: SslOptions
pub const NO_TICKET: SslOptions
Disables the use of session tickets for session resumption.
sourcepub const NO_SESSION_RESUMPTION_ON_RENEGOTIATION: SslOptions
pub const NO_SESSION_RESUMPTION_ON_RENEGOTIATION: SslOptions
Always start a new session when performing a renegotiation on the server side.
sourcepub const NO_COMPRESSION: SslOptions
pub const NO_COMPRESSION: SslOptions
Disables the use of TLS compression.
sourcepub const ALLOW_UNSAFE_LEGACY_RENEGOTIATION: SslOptions
pub const ALLOW_UNSAFE_LEGACY_RENEGOTIATION: SslOptions
Allow legacy insecure renegotiation with servers or clients that do not support secure renegotiation.
sourcepub const SINGLE_ECDH_USE: SslOptions
pub const SINGLE_ECDH_USE: SslOptions
Creates a new key for each session when using ECDHE.
This is always enabled in OpenSSL 1.1.0.
sourcepub const SINGLE_DH_USE: SslOptions
pub const SINGLE_DH_USE: SslOptions
Creates a new key for each session when using DHE.
This is always enabled in OpenSSL 1.1.0.
sourcepub const CIPHER_SERVER_PREFERENCE: SslOptions
pub const CIPHER_SERVER_PREFERENCE: SslOptions
Use the server’s preferences rather than the client’s when selecting a cipher.
This has no effect on the client side.
sourcepub const TLS_ROLLBACK_BUG: SslOptions
pub const TLS_ROLLBACK_BUG: SslOptions
Disables version rollback attach detection.
sourcepub const NO_SSLV2: SslOptions
pub const NO_SSLV2: SslOptions
Disables the use of SSLv2.
sourcepub const NO_SSLV3: SslOptions
pub const NO_SSLV3: SslOptions
Disables the use of SSLv3.
sourcepub const NO_TLSV1: SslOptions
pub const NO_TLSV1: SslOptions
Disables the use of TLSv1.0.
sourcepub const NO_TLSV1_1: SslOptions
pub const NO_TLSV1_1: SslOptions
Disables the use of TLSv1.1.
sourcepub const NO_TLSV1_2: SslOptions
pub const NO_TLSV1_2: SslOptions
Disables the use of TLSv1.2.
sourcepub const NO_TLSV1_3: SslOptions
pub const NO_TLSV1_3: SslOptions
Disables the use of TLSv1.3.
Requires OpenSSL 1.1.1 or newer.
sourcepub const NO_DTLSV1: SslOptions
pub const NO_DTLSV1: SslOptions
Disables the use of DTLSv1.0
Requires OpenSSL 1.0.2 or LibreSSL 3.3.2 or newer.
sourcepub const NO_DTLSV1_2: SslOptions
pub const NO_DTLSV1_2: SslOptions
Disables the use of DTLSv1.2.
Requires OpenSSL 1.0.2 or LibreSSL 3.3.2 or newer.
sourcepub const NO_SSL_MASK: SslOptions
pub const NO_SSL_MASK: SslOptions
Disables the use of all (D)TLS protocol versions.
This can be used as a mask when whitelisting protocol versions.
Requires OpenSSL 1.0.2 or newer.
Examples
Only support TLSv1.2:
use openssl::ssl::SslOptions;
let options = SslOptions::NO_SSL_MASK & !SslOptions::NO_TLSV1_2;
sourcepub const ENABLE_MIDDLEBOX_COMPAT: SslOptions
pub const ENABLE_MIDDLEBOX_COMPAT: SslOptions
Enable TLSv1.3 Compatibility mode.
Requires OpenSSL 1.1.1 or newer. This is on by default in 1.1.1, but a future version may have this disabled by default.
sourcepub const fn empty() -> SslOptions
pub const fn empty() -> SslOptions
Returns an empty set of flags
sourcepub const fn all() -> SslOptions
pub const fn all() -> SslOptions
Returns the set containing all flags.
sourcepub fn from_bits(bits: c_ulong) -> Option<SslOptions>
pub fn from_bits(bits: c_ulong) -> Option<SslOptions>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
sourcepub const fn from_bits_truncate(bits: c_ulong) -> SslOptions
pub const fn from_bits_truncate(bits: c_ulong) -> SslOptions
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
sourcepub const unsafe fn from_bits_unchecked(bits: c_ulong) -> SslOptions
pub const unsafe fn from_bits_unchecked(bits: c_ulong) -> SslOptions
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
sourcepub const fn intersects(&self, other: SslOptions) -> bool
pub const fn intersects(&self, other: SslOptions) -> bool
Returns true
if there are flags common to both self
and other
.
sourcepub const fn contains(&self, other: SslOptions) -> bool
pub const fn contains(&self, other: SslOptions) -> bool
Returns true
all of the flags in other
are contained within self
.
sourcepub fn insert(&mut self, other: SslOptions)
pub fn insert(&mut self, other: SslOptions)
Inserts the specified flags in-place.
sourcepub fn remove(&mut self, other: SslOptions)
pub fn remove(&mut self, other: SslOptions)
Removes the specified flags in-place.
sourcepub fn toggle(&mut self, other: SslOptions)
pub fn toggle(&mut self, other: SslOptions)
Toggles the specified flags in-place.
sourcepub fn set(&mut self, other: SslOptions, value: bool)
pub fn set(&mut self, other: SslOptions, value: bool)
Inserts or removes the specified flags depending on the passed value.
Trait Implementations
sourceimpl Binary for SslOptions
impl Binary for SslOptions
sourceimpl BitAnd<SslOptions> for SslOptions
impl BitAnd<SslOptions> for SslOptions
sourcefn bitand(self, other: SslOptions) -> SslOptions
fn bitand(self, other: SslOptions) -> SslOptions
Returns the intersection between the two sets of flags.
type Output = SslOptions
type Output = SslOptions
The resulting type after applying the &
operator.
sourceimpl BitAndAssign<SslOptions> for SslOptions
impl BitAndAssign<SslOptions> for SslOptions
sourcefn bitand_assign(&mut self, other: SslOptions)
fn bitand_assign(&mut self, other: SslOptions)
Disables all flags disabled in the set.
sourceimpl BitOr<SslOptions> for SslOptions
impl BitOr<SslOptions> for SslOptions
sourcefn bitor(self, other: SslOptions) -> SslOptions
fn bitor(self, other: SslOptions) -> SslOptions
Returns the union of the two sets of flags.
type Output = SslOptions
type Output = SslOptions
The resulting type after applying the |
operator.
sourceimpl BitOrAssign<SslOptions> for SslOptions
impl BitOrAssign<SslOptions> for SslOptions
sourcefn bitor_assign(&mut self, other: SslOptions)
fn bitor_assign(&mut self, other: SslOptions)
Adds the set of flags.
sourceimpl BitXor<SslOptions> for SslOptions
impl BitXor<SslOptions> for SslOptions
sourcefn bitxor(self, other: SslOptions) -> SslOptions
fn bitxor(self, other: SslOptions) -> SslOptions
Returns the left flags, but with all the right flags toggled.
type Output = SslOptions
type Output = SslOptions
The resulting type after applying the ^
operator.
sourceimpl BitXorAssign<SslOptions> for SslOptions
impl BitXorAssign<SslOptions> for SslOptions
sourcefn bitxor_assign(&mut self, other: SslOptions)
fn bitxor_assign(&mut self, other: SslOptions)
Toggles the set of flags.
sourceimpl Clone for SslOptions
impl Clone for SslOptions
sourcefn clone(&self) -> SslOptions
fn clone(&self) -> SslOptions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SslOptions
impl Debug for SslOptions
sourceimpl Extend<SslOptions> for SslOptions
impl Extend<SslOptions> for SslOptions
sourcefn extend<T: IntoIterator<Item = SslOptions>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = SslOptions>>(&mut self, iterator: T)
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl FromIterator<SslOptions> for SslOptions
impl FromIterator<SslOptions> for SslOptions
sourcefn from_iter<T: IntoIterator<Item = SslOptions>>(iterator: T) -> SslOptions
fn from_iter<T: IntoIterator<Item = SslOptions>>(iterator: T) -> SslOptions
Creates a value from an iterator. Read more
sourceimpl Hash for SslOptions
impl Hash for SslOptions
sourceimpl LowerHex for SslOptions
impl LowerHex for SslOptions
sourceimpl Not for SslOptions
impl Not for SslOptions
sourcefn not(self) -> SslOptions
fn not(self) -> SslOptions
Returns the complement of this set of flags.
type Output = SslOptions
type Output = SslOptions
The resulting type after applying the !
operator.
sourceimpl Octal for SslOptions
impl Octal for SslOptions
sourceimpl Ord for SslOptions
impl Ord for SslOptions
sourceimpl PartialEq<SslOptions> for SslOptions
impl PartialEq<SslOptions> for SslOptions
sourcefn eq(&self, other: &SslOptions) -> bool
fn eq(&self, other: &SslOptions) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &SslOptions) -> bool
fn ne(&self, other: &SslOptions) -> bool
This method tests for !=
.
sourceimpl PartialOrd<SslOptions> for SslOptions
impl PartialOrd<SslOptions> for SslOptions
sourcefn partial_cmp(&self, other: &SslOptions) -> Option<Ordering>
fn partial_cmp(&self, other: &SslOptions) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl Sub<SslOptions> for SslOptions
impl Sub<SslOptions> for SslOptions
sourcefn sub(self, other: SslOptions) -> SslOptions
fn sub(self, other: SslOptions) -> SslOptions
Returns the set difference of the two sets of flags.
type Output = SslOptions
type Output = SslOptions
The resulting type after applying the -
operator.
sourceimpl SubAssign<SslOptions> for SslOptions
impl SubAssign<SslOptions> for SslOptions
sourcefn sub_assign(&mut self, other: SslOptions)
fn sub_assign(&mut self, other: SslOptions)
Disables all flags enabled in the set.
sourceimpl UpperHex for SslOptions
impl UpperHex for SslOptions
impl Copy for SslOptions
impl Eq for SslOptions
impl StructuralEq for SslOptions
impl StructuralPartialEq for SslOptions
Auto Trait Implementations
impl RefUnwindSafe for SslOptions
impl Send for SslOptions
impl Sync for SslOptions
impl Unpin for SslOptions
impl UnwindSafe for SslOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more