pub struct TlsOptions { /* private fields */ }
Available on crate feature
tls
only.Expand description
Options for tls connection.
Implementations§
Source§impl TlsOptions
impl TlsOptions
Sourcepub fn no_ca() -> Self
👎Deprecated since 0.10.0: use TlsOptions::new instead
pub fn no_ca() -> Self
Tls options with no ca certificates.
Sourcepub unsafe fn with_no_hostname_verification(self) -> Self
pub unsafe fn with_no_hostname_verification(self) -> Self
Disables hostname verification in tls handshake.
§Safety
This exposes risk to man-in-the-middle attacks.
Sourcepub fn with_fips(self) -> Self
Available on crate features fips
or fips-only
only.
pub fn with_fips(self) -> Self
fips
or fips-only
only.Enables FIPS mode at runtime for tls connection.
This is a nop in case of “fips-only” feature is enabled.
Sourcepub fn with_pem_ca_certs(self, certs: &str) -> Result<Self, Error>
👎Deprecated since 0.10.0: use TlsOptions::with_pem_ca instead
pub fn with_pem_ca_certs(self, certs: &str) -> Result<Self, Error>
Adds new ca certificates.
It behaves different to TlsOptions::with_pem_ca in two ways:
- It is additive.
- It takes only certs into account.
Sourcepub fn with_pem_ca(self, ca: &str) -> Result<Self, Error>
pub fn with_pem_ca(self, ca: &str) -> Result<Self, Error>
Specifies ca certificates and also crls.
See also TlsCa::from_pem.
Sourcepub fn with_pem_identity(self, cert: &str, key: &str) -> Result<Self, Error>
pub fn with_pem_identity(self, cert: &str, key: &str) -> Result<Self, Error>
Specifies client identity for server to authenticate.
See also TlsIdentity::from_pem.
Sourcepub fn with_certs(self, certs: impl Into<TlsCertsOptions>) -> Self
pub fn with_certs(self, certs: impl Into<TlsCertsOptions>) -> Self
Specifies certificates to connection to server. This takes precedence over TlsOptions::with_pem_identity and TlsOptions::with_pem_ca.
Trait Implementations§
Source§impl Clone for TlsOptions
impl Clone for TlsOptions
Source§fn clone(&self) -> TlsOptions
fn clone(&self) -> TlsOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TlsOptions
impl Debug for TlsOptions
Auto Trait Implementations§
impl Freeze for TlsOptions
impl RefUnwindSafe for TlsOptions
impl Send for TlsOptions
impl Sync for TlsOptions
impl Unpin for TlsOptions
impl UnwindSafe for TlsOptions
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 more