Struct lettre::transport::smtp::client::TlsParametersBuilder[][src]

pub struct TlsParametersBuilder { /* fields omitted */ }
This is supported on crate feature smtp-transport only.

Builder for TlsParameters

Implementations

impl TlsParametersBuilder[src]

pub fn new(domain: String) -> Self[src]

Creates a new builder for TlsParameters

pub fn add_root_certificate(self, cert: Certificate) -> Self[src]

Add a custom root certificate

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

pub fn dangerous_accept_invalid_hostnames(
    self,
    accept_invalid_hostnames: bool
) -> Self
[src]

This is supported 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.

pub fn dangerous_accept_invalid_certs(self, accept_invalid_certs: bool) -> Self[src]

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.

pub fn build(self) -> Result<TlsParameters, Error>[src]

This is supported on crate features native-tls or rustls-tls only.

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

pub fn build_native(self) -> Result<TlsParameters, Error>[src]

This is supported on crate feature native-tls only.

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

pub fn build_rustls(self) -> Result<TlsParameters, Error>[src]

This is supported on crate feature rustls-tls only.

Creates a new TlsParameters using rustls with the provided configuration

Trait Implementations

impl Clone for TlsParametersBuilder[src]

impl Debug for TlsParametersBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.