Type Alias vector_core::tls::MaybeTlsSettings

source ·
pub type MaybeTlsSettings = MaybeTls<(), TlsSettings>;

Aliased Type§

enum MaybeTlsSettings {
    Raw(()),
    Tls(TlsSettings),
}

Variants§

Implementations§

source§

impl MaybeTlsSettings

source

pub async fn bind(&self, addr: &SocketAddr) -> Result<MaybeTlsListener>

source

pub async fn bind_with_allowlist( &self, addr: &SocketAddr, allow_origin: Vec<IpNet>, ) -> Result<MaybeTlsListener>

source§

impl MaybeTlsSettings

source

pub async fn connect( &self, host: &str, addr: &SocketAddr, ) -> Result<MaybeTlsStream<TcpStream>>

source§

impl MaybeTlsSettings

source

pub fn enable_client() -> Result<Self>

source

pub fn tls_client(config: &Option<TlsConfig>) -> Result<Self>

source

pub fn from_config( config: &Option<TlsEnableableConfig>, for_server: bool, ) -> Result<Self>

Generate an optional settings struct from the given optional configuration reference. If config is None, TLS is disabled. The for_server parameter indicates the options should be interpreted as being for a TLS server, which requires an identity certificate and changes the certificate verification default to false.

source

pub const fn http_protocol_name(&self) -> &'static str

Trait Implementations§

source§

impl From<TlsSettings> for MaybeTlsSettings

source§

fn from(tls: TlsSettings) -> Self

Converts to this type from the input type.