Trait tls_api::TlsConnectorBuilder[][src]

pub trait TlsConnectorBuilder: Sized + Sync + Send + 'static {
    type Connector: TlsConnector;
    type Underlying;
    fn underlying_mut(&mut self) -> &mut Self::Underlying;
fn set_alpn_protocols(&mut self, protocols: &[&[u8]]) -> Result<()>;
fn set_verify_hostname(&mut self, verify: bool) -> Result<()>;
fn add_root_certificate(&mut self, cert: &[u8]) -> Result<()>;
fn build(self) -> Result<Self::Connector>; }

A builder for TlsConnectors.

Associated Types

type Connector: TlsConnector[src][]

Result of connector to be build.

type Underlying[src][]

Type of the underlying builder.

In the world of HKT this would be:

type TlsStream<S: TlsStreamDyn> : TlsStreamWithSocketDyn<S>;

Note each implementation has accept_impl function which returns more specific type, providing both access to implementation details and the underlying socket.

Required methods

fn underlying_mut(&mut self) -> &mut Self::Underlying[src][]

Get the underlying builder.

API intentionally exposes the underlying acceptor builder to allow fine tuning not possible in common API.

fn set_alpn_protocols(&mut self, protocols: &[&[u8]]) -> Result<()>[src][]

Set ALPN-protocols to negotiate.

This operations fails is not TlsConnector::SUPPORTS_ALPN.

fn set_verify_hostname(&mut self, verify: bool) -> Result<()>[src][]

Should hostname verification be performed? Use carefully, it opens the door to MITM attacks.

fn add_root_certificate(&mut self, cert: &[u8]) -> Result<()>[src][]

Add trusted root certificate. By default connector supports only global trusted root.

Param is DER-encoded X.509 certificate.

fn build(self) -> Result<Self::Connector>[src][]

Finish the acceptor construction.

Implementors