[][src]Struct security_framework::secure_transport::ClientBuilder

pub struct ClientBuilder { /* fields omitted */ }

A builder type to simplify the creation of client side SslStreams.

Methods

impl ClientBuilder[src]

pub fn new() -> Self[src]

Creates a new builder with default options.

pub fn anchor_certificates(&mut self, certs: &[SecCertificate]) -> &mut Self[src]

Specifies the set of root certificates to trust when verifying the server's certificate.

pub fn trust_anchor_certificates_only(&mut self, only: bool) -> &mut Self[src]

Specifies whether to trust the built-in certificates in addition to specified anchor certificates.

pub fn danger_accept_invalid_certs(&mut self, noverify: bool) -> &mut Self[src]

Specifies whether to trust invalid certificates.

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 Self[src]

Specifies whether to use Server Name Indication (SNI).

pub fn danger_accept_invalid_hostnames(
    &mut self,
    danger_accept_invalid_hostnames: bool
) -> &mut Self
[src]

Specifies whether to verify that the server's hostname matches its certificate.

Warning

You should think very carefully before using this method. If hostnames are not verified, 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 whitelist_ciphers(
    &mut self,
    whitelisted_ciphers: &[CipherSuite]
) -> &mut Self
[src]

Set a whitelist of enabled ciphers. Any ciphers not whitelisted will be disabled.

pub fn blacklist_ciphers(
    &mut self,
    blacklisted_ciphers: &[CipherSuite]
) -> &mut Self
[src]

Set a blacklist of disabled ciphers. Blacklisted ciphers will be disabled.

pub fn identity(
    &mut self,
    identity: &SecIdentity,
    chain: &[SecCertificate]
) -> &mut Self
[src]

Use the specified identity as a SSL/TLS client certificate.

pub fn protocol_min(&mut self, min: SslProtocol) -> &mut Self[src]

Configure the minimum protocol that this client will support.

pub fn protocol_max(&mut self, max: SslProtocol) -> &mut Self[src]

Configure the minimum protocol that this client will support.

pub fn alpn_protocols(&mut self, protocols: &[&str]) -> &mut Self[src]

Configures the set of protocols used for ALPN.

pub fn handshake<S>(
    &self,
    domain: &str,
    stream: S
) -> Result<SslStream<S>, ClientHandshakeError<S>> where
    S: Read + Write
[src]

Initiates a new SSL/TLS session over a stream connected to the specified domain.

If both SNI and hostname verification are disabled, the value of domain will be ignored.

Trait Implementations

impl Default for ClientBuilder[src]

impl Debug for ClientBuilder[src]

Auto Trait Implementations

impl Send for ClientBuilder

impl Sync for ClientBuilder

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.