pub struct TlsBuilder { /* private fields */ }Expand description
Fluent builder for TlsConfig.
Implementations§
Source§impl TlsBuilder
impl TlsBuilder
Sourcepub fn enabled(self, enabled: bool) -> Self
pub fn enabled(self, enabled: bool) -> Self
Enable or disable TLS interception while retaining the remaining TLS settings.
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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TlsBuilder
impl RefUnwindSafe for TlsBuilder
impl Send for TlsBuilder
impl Sync for TlsBuilder
impl Unpin for TlsBuilder
impl UnsafeUnpin for TlsBuilder
impl UnwindSafe for TlsBuilder
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more