Struct native_tls::TlsConnectorBuilder[][src]

pub struct TlsConnectorBuilder { /* fields omitted */ }

A builder for TlsConnectors.

Methods

impl TlsConnectorBuilder
[src]

Sets the identity to be used for client certificate authentication.

Sets the minimum supported protocol version.

A value of None enables support for the oldest protocols supported by the implementation.

Defaults to Some(Protocol::Tlsv10).

Sets the maximum supported protocol version.

A value of None enables support for the newest protocols supported by the implementation.

Defaults to None.

Adds a certificate to the set of roots that the connector will trust.

The connector will use the system's trust root by default. This method can be used to add to that set when communicating with servers not trusted by the system.

Defaults to an empty set.

Controls the use of certificate validation.

Defaults to false.

Warning

You should think very carefully before using this method. If invalid certificates are trusted, any certificate for any site will be trusted for use. This includes expired certificates. This introduces significant vulnerabilities, and should only be used as a last resort.

Controls the use of Server Name Indication (SNI).

Defaults to true.

Controls the use of hostname verification.

Defaults to false.

Warning

You should think very carefully before using this method. If invalid hostnames are trusted, any valid certificate for any site will be trusted for use. This introduces significant vulnerabilities, and should only be used as a last resort.

Creates a new TlsConnector.

Auto Trait Implementations