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 = SslOptions{bits: ffi::SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS,}
pub const DONT_INSERT_EMPTY_FRAGMENTS: SslOptions = SslOptions{bits: ffi::SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS,}
Disables a countermeasure against an SSLv3/TLSv1.0 vulnerability affecting CBC ciphers.
sourcepub const ALL: SslOptions = SslOptions{bits: ffi::SSL_OP_ALL,}
pub const ALL: SslOptions = SslOptions{bits: ffi::SSL_OP_ALL,}
A “reasonable default” set of options which enables compatibility flags.
sourcepub const NO_QUERY_MTU: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_QUERY_MTU,}
pub const NO_QUERY_MTU: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_QUERY_MTU,}
Do not query the MTU.
Only affects DTLS connections.
sourcepub const COOKIE_EXCHANGE: SslOptions = SslOptions{bits: ffi::SSL_OP_COOKIE_EXCHANGE,}
pub const COOKIE_EXCHANGE: SslOptions = SslOptions{bits: ffi::SSL_OP_COOKIE_EXCHANGE,}
Enables Cookie Exchange as described in RFC 4347 Section 4.2.1.
Only affects DTLS connections.
sourcepub const NO_TICKET: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_TICKET,}
pub const NO_TICKET: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_TICKET,}
Disables the use of session tickets for session resumption.
sourcepub const NO_SESSION_RESUMPTION_ON_RENEGOTIATION: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION,}
pub const NO_SESSION_RESUMPTION_ON_RENEGOTIATION: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION,}
Always start a new session when performing a renegotiation on the server side.
sourcepub const NO_COMPRESSION: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_COMPRESSION,}
pub const NO_COMPRESSION: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_COMPRESSION,}
Disables the use of TLS compression.
sourcepub const ALLOW_UNSAFE_LEGACY_RENEGOTIATION: SslOptions = SslOptions{bits: ffi::SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION,}
pub const ALLOW_UNSAFE_LEGACY_RENEGOTIATION: SslOptions = SslOptions{bits: ffi::SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION,}
Allow legacy insecure renegotiation with servers or clients that do not support secure renegotiation.
sourcepub const SINGLE_ECDH_USE: SslOptions = SslOptions{bits: ffi::SSL_OP_SINGLE_ECDH_USE,}
pub const SINGLE_ECDH_USE: SslOptions = SslOptions{bits: ffi::SSL_OP_SINGLE_ECDH_USE,}
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 = SslOptions{bits: ffi::SSL_OP_SINGLE_DH_USE,}
pub const SINGLE_DH_USE: SslOptions = SslOptions{bits: ffi::SSL_OP_SINGLE_DH_USE,}
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 = SslOptions{bits: ffi::SSL_OP_CIPHER_SERVER_PREFERENCE,}
pub const CIPHER_SERVER_PREFERENCE: SslOptions = SslOptions{bits: ffi::SSL_OP_CIPHER_SERVER_PREFERENCE,}
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 = SslOptions{bits: ffi::SSL_OP_TLS_ROLLBACK_BUG,}
pub const TLS_ROLLBACK_BUG: SslOptions = SslOptions{bits: ffi::SSL_OP_TLS_ROLLBACK_BUG,}
Disables version rollback attach detection.
sourcepub const NO_SSLV2: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_SSLv2,}
pub const NO_SSLV2: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_SSLv2,}
Disables the use of SSLv2.
sourcepub const NO_SSLV3: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_SSLv3,}
pub const NO_SSLV3: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_SSLv3,}
Disables the use of SSLv3.
sourcepub const NO_TLSV1: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_TLSv1,}
pub const NO_TLSV1: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_TLSv1,}
Disables the use of TLSv1.0.
sourcepub const NO_TLSV1_1: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_TLSv1_1,}
pub const NO_TLSV1_1: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_TLSv1_1,}
Disables the use of TLSv1.1.
sourcepub const NO_TLSV1_2: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_TLSv1_2,}
pub const NO_TLSV1_2: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_TLSv1_2,}
Disables the use of TLSv1.2.
sourcepub const NO_TLSV1_3: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_TLSv1_3,}
pub const NO_TLSV1_3: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_TLSv1_3,}
Disables the use of TLSv1.3.
Requires OpenSSL 1.1.1 or newer.
sourcepub const NO_DTLSV1: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_DTLSv1,}
pub const NO_DTLSV1: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_DTLSv1,}
Disables the use of DTLSv1.0
Requires OpenSSL 1.0.2 or LibreSSL 3.3.2 or newer.
sourcepub const NO_DTLSV1_2: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_DTLSv1_2,}
pub const NO_DTLSV1_2: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_DTLSv1_2,}
Disables the use of DTLSv1.2.
Requires OpenSSL 1.0.2 or LibreSSL 3.3.2 or newer.
sourcepub const NO_SSL_MASK: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_SSL_MASK,}
pub const NO_SSL_MASK: SslOptions = SslOptions{bits: ffi::SSL_OP_NO_SSL_MASK,}
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 = SslOptions{bits: ffi::SSL_OP_ENABLE_MIDDLEBOX_COMPAT,}
pub const ENABLE_MIDDLEBOX_COMPAT: SslOptions = SslOptions{bits: ffi::SSL_OP_ENABLE_MIDDLEBOX_COMPAT,}
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 · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more