pub trait TlsConnectorBuilder:
Sized
+ Sync
+ Send
+ 'static {
type Connector: TlsConnector;
type Underlying;
// Required methods
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 TlsConnector
s.
Required Associated Types§
Sourcetype Connector: TlsConnector
type Connector: TlsConnector
Result of connector to be build.
Sourcetype Underlying
type Underlying
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§
Sourcefn underlying_mut(&mut self) -> &mut Self::Underlying
fn underlying_mut(&mut self) -> &mut Self::Underlying
Get the underlying builder.
API intentionally exposes the underlying acceptor builder to allow fine tuning not possible in common API.
Sourcefn set_alpn_protocols(&mut self, protocols: &[&[u8]]) -> Result<()>
fn set_alpn_protocols(&mut self, protocols: &[&[u8]]) -> Result<()>
Set ALPN-protocols to negotiate.
This operations fails is not TlsConnector::SUPPORTS_ALPN
.
Sourcefn set_verify_hostname(&mut self, verify: bool) -> Result<()>
fn set_verify_hostname(&mut self, verify: bool) -> Result<()>
Should hostname verification be performed? Use carefully, it opens the door to MITM attacks.
Sourcefn add_root_certificate(&mut self, cert: &[u8]) -> Result<()>
fn add_root_certificate(&mut self, cert: &[u8]) -> Result<()>
Add trusted root certificate. By default connector supports only global trusted root.
Param is DER-encoded X.509 certificate.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.