logo
pub struct TlsParametersBuilder { /* private fields */ }
Available on crate feature smtp-transport only.
Expand description

Builder for TlsParameters

Implementations

Creates a new builder for TlsParameters

Add a custom root certificate

Can be used to safely connect to a server using a self signed certificate, for example.

Available on crate feature native-tls only.

Controls whether certificates with an invalid hostname are accepted

Defaults to false.

Warning

You should think very carefully before using this method. If hostname verification is disabled any valid certificate, including those from other sites, are trusted.

This method introduces significant vulnerabilities to man-in-the-middle attacks.

Hostname verification can only be disabled with the native-tls TLS backend.

Controls whether invalid certificates are accepted

Defaults to false.

Warning

You should think very carefully before using this method. If certificate verification is disabled, any certificate is trusted for use, including:

  • Self signed certificates
  • Certificates from different hostnames
  • Expired certificates

This method should only be used as a last resort, as it introduces significant vulnerabilities to man-in-the-middle attacks.

Available on crate features native-tls or rustls-tls only.

Creates a new TlsParameters using native-tls or rustls depending on which one is available

Available on crate feature native-tls only.

Creates a new TlsParameters using native-tls with the provided configuration

Available on crate feature rustls-tls only.

Creates a new TlsParameters using rustls with the provided configuration

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more