pub struct TlsBuilder { /* private fields */ }Expand description
Fluent builder for TlsConfig.
Implementations§
Source§impl TlsBuilder
impl TlsBuilder
Sourcepub fn bypass(self, pattern: impl Into<String>) -> Self
pub fn bypass(self, pattern: impl Into<String>) -> Self
Add a domain to the bypass list (no MITM). Supports *.suffix wildcards.
Sourcepub fn verify_upstream(self, verify: bool) -> Self
pub fn verify_upstream(self, verify: bool) -> Self
Enable or disable upstream server certificate verification.
Sourcepub fn verify_upstream_for(
self,
pattern: impl Into<String>,
verify: bool,
) -> Self
pub fn verify_upstream_for( self, pattern: impl Into<String>, verify: bool, ) -> Self
Enable or disable upstream server certificate verification only
when the upstream SNI matches pattern.
Pattern syntax matches Self::bypass: exact hosts and *.suffix
wildcards are supported.
Sourcepub fn intercepted_ports(self, ports: Vec<u16>) -> Self
pub fn intercepted_ports(self, ports: Vec<u16>) -> Self
Set the ports to intercept.
Sourcepub fn block_quic(self, block: bool) -> Self
pub fn block_quic(self, block: bool) -> Self
Enable or disable QUIC blocking on intercepted ports.
Sourcepub fn upstream_ca_cert(self, path: impl Into<PathBuf>) -> Self
pub fn upstream_ca_cert(self, path: impl Into<PathBuf>) -> Self
Add a CA certificate PEM file to trust for upstream server verification.
Useful when the upstream server uses a self-signed or private CA certificate. Can be called multiple times to add several CAs.
Sourcepub fn upstream_ca_cert_for(
self,
pattern: impl Into<String>,
path: impl Into<PathBuf>,
) -> Self
pub fn upstream_ca_cert_for( self, pattern: impl Into<String>, path: impl Into<PathBuf>, ) -> Self
Add a CA certificate PEM file to trust for upstream server verification
only when the upstream SNI matches pattern.
Pattern syntax matches Self::bypass: exact hosts and *.suffix
wildcards are supported. Can be called multiple times to add several
CAs for the same host pattern.
Sourcepub fn intercept_ca_cert(self, path: impl Into<PathBuf>) -> Self
pub fn intercept_ca_cert(self, path: impl Into<PathBuf>) -> Self
Set a custom interception CA certificate PEM file path.
Sourcepub fn intercept_ca_key(self, path: impl Into<PathBuf>) -> Self
pub fn intercept_ca_key(self, path: impl Into<PathBuf>) -> Self
Set a custom interception CA private key PEM file path.