pub struct TlsConfigBuilder { /* private fields */ }Expand description
Builder for TLS configuration
Implementations§
Source§impl TlsConfigBuilder
impl TlsConfigBuilder
Sourcepub fn with_cert_file<P: Into<PathBuf>>(self, path: P) -> Self
pub fn with_cert_file<P: Into<PathBuf>>(self, path: P) -> Self
Set the server certificate from a file
Sourcepub fn with_cert_pem(self, pem: String) -> Self
pub fn with_cert_pem(self, pem: String) -> Self
Set the server certificate from PEM content
Sourcepub fn with_key_file<P: Into<PathBuf>>(self, path: P) -> Self
pub fn with_key_file<P: Into<PathBuf>>(self, path: P) -> Self
Set the private key from a file
Sourcepub fn with_key_pem(self, pem: String) -> Self
pub fn with_key_pem(self, pem: String) -> Self
Set the private key from PEM content
Sourcepub fn with_root_ca_file<P: Into<PathBuf>>(self, path: P) -> Self
pub fn with_root_ca_file<P: Into<PathBuf>>(self, path: P) -> Self
Set the root CA for server verification (client-side)
Sourcepub fn with_client_ca_file<P: Into<PathBuf>>(self, path: P) -> Self
pub fn with_client_ca_file<P: Into<PathBuf>>(self, path: P) -> Self
Set the client CA for mTLS (server-side)
Sourcepub fn require_client_cert(self, required: bool) -> Self
pub fn require_client_cert(self, required: bool) -> Self
Require client certificate (mTLS)
Sourcepub fn with_mtls_mode(self, mode: MtlsMode) -> Self
pub fn with_mtls_mode(self, mode: MtlsMode) -> Self
Set mTLS mode
Sourcepub fn with_min_version(self, version: TlsVersion) -> Self
pub fn with_min_version(self, version: TlsVersion) -> Self
Set minimum TLS version
Sourcepub fn with_alpn_protocols(self, protocols: Vec<String>) -> Self
pub fn with_alpn_protocols(self, protocols: Vec<String>) -> Self
Set ALPN protocols
Sourcepub fn with_server_name(self, name: String) -> Self
pub fn with_server_name(self, name: String) -> Self
Set server name for SNI
Sourcepub fn insecure_skip_verify(self) -> Self
pub fn insecure_skip_verify(self) -> Self
Skip certificate verification (DANGEROUS - testing only)
Sourcepub fn with_pinned_certificate(self, fingerprint: String) -> Self
pub fn with_pinned_certificate(self, fingerprint: String) -> Self
Add pinned certificate fingerprint
Sourcepub fn with_self_signed(self, common_name: &str) -> Self
pub fn with_self_signed(self, common_name: &str) -> Self
Use self-signed certificate
Sourcepub fn with_cert_reload_interval(self, interval: Duration) -> Self
pub fn with_cert_reload_interval(self, interval: Duration) -> Self
Enable certificate reloading
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TlsConfigBuilder
impl RefUnwindSafe for TlsConfigBuilder
impl Send for TlsConfigBuilder
impl Sync for TlsConfigBuilder
impl Unpin for TlsConfigBuilder
impl UnwindSafe for TlsConfigBuilder
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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