Struct native_tls::TlsConnectorBuilder [−][src]
A builder for TlsConnector
s.
Implementations
impl TlsConnectorBuilder
[src]
pub fn identity(&mut self, identity: Identity) -> &mut TlsConnectorBuilder
[src]
Sets the identity to be used for client certificate authentication.
pub fn min_protocol_version(
&mut self,
protocol: Option<Protocol>
) -> &mut TlsConnectorBuilder
[src]
&mut self,
protocol: Option<Protocol>
) -> &mut TlsConnectorBuilder
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)
.
pub fn max_protocol_version(
&mut self,
protocol: Option<Protocol>
) -> &mut TlsConnectorBuilder
[src]
&mut self,
protocol: Option<Protocol>
) -> &mut TlsConnectorBuilder
Sets the maximum supported protocol version.
A value of None
enables support for the newest protocols supported by the implementation.
Defaults to None
.
pub fn add_root_certificate(
&mut self,
cert: Certificate
) -> &mut TlsConnectorBuilder
[src]
&mut self,
cert: Certificate
) -> &mut TlsConnectorBuilder
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.
pub fn disable_built_in_roots(
&mut self,
disable: bool
) -> &mut TlsConnectorBuilder
[src]
&mut self,
disable: bool
) -> &mut TlsConnectorBuilder
Controls the use of built-in system certificates during certificate validation.
Defaults to false
– built-in system certs will be used.
pub fn danger_accept_invalid_certs(
&mut self,
accept_invalid_certs: bool
) -> &mut TlsConnectorBuilder
[src]
&mut self,
accept_invalid_certs: bool
) -> &mut TlsConnectorBuilder
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.
pub fn use_sni(&mut self, use_sni: bool) -> &mut TlsConnectorBuilder
[src]
Controls the use of Server Name Indication (SNI).
Defaults to true
.
pub fn danger_accept_invalid_hostnames(
&mut self,
accept_invalid_hostnames: bool
) -> &mut TlsConnectorBuilder
[src]
&mut self,
accept_invalid_hostnames: bool
) -> &mut TlsConnectorBuilder
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.
pub fn build(&self) -> Result<TlsConnector>
[src]
Creates a new TlsConnector
.
Auto Trait Implementations
impl RefUnwindSafe for TlsConnectorBuilder
impl Send for TlsConnectorBuilder
impl Sync for TlsConnectorBuilder
impl Unpin for TlsConnectorBuilder
impl UnwindSafe for TlsConnectorBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,