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>;
}
Expand description

A builder for TlsConnectors.

Required Associated Types

Result of connector to be build.

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

Get the underlying builder.

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

Set ALPN-protocols to negotiate.

This operations fails is not TlsConnector::SUPPORTS_ALPN.

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

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

Param is DER-encoded X.509 certificate.

Finish the acceptor construction.

Implementors