pub struct TlsConfig {Show 15 fields
pub enabled: bool,
pub certificate: Option<CertificateSource>,
pub private_key: Option<PrivateKeySource>,
pub root_ca: Option<CertificateSource>,
pub client_ca: Option<CertificateSource>,
pub mtls_mode: MtlsMode,
pub min_version: TlsVersion,
pub alpn_protocols: Vec<String>,
pub ocsp_stapling: bool,
pub pinned_certificates: Vec<String>,
pub insecure_skip_verify: bool,
pub server_name: Option<String>,
pub session_cache_size: usize,
pub session_ticket_lifetime: Duration,
pub cert_reload_interval: Duration,
}Expand description
Complete TLS configuration for a component
Fields§
§enabled: boolWhether TLS is enabled
certificate: Option<CertificateSource>Server certificate and chain
private_key: Option<PrivateKeySource>Server private key
root_ca: Option<CertificateSource>Root CA certificates for verification
client_ca: Option<CertificateSource>Client CA certificates for mTLS verification
mtls_mode: MtlsModemTLS mode
min_version: TlsVersionMinimum TLS version
alpn_protocols: Vec<String>ALPN protocols (e.g., [“h2”, “http/1.1”])
ocsp_stapling: boolEnable OCSP stapling
pinned_certificates: Vec<String>Certificate pinning (SHA-256 fingerprints)
insecure_skip_verify: boolSkip certificate verification (DANGEROUS - testing only)
server_name: Option<String>Server name for SNI (client-side)
session_cache_size: usizeSession cache size (0 to disable)
session_ticket_lifetime: DurationSession ticket lifetime
cert_reload_interval: DurationCertificate reload interval (0 to disable)
Implementations§
Source§impl TlsConfig
impl TlsConfig
Sourcepub fn self_signed(common_name: &str) -> Self
pub fn self_signed(common_name: &str) -> Self
Create TLS configuration for development with self-signed certificates
Sourcepub fn from_pem_files<P: Into<PathBuf>>(cert_path: P, key_path: P) -> Self
pub fn from_pem_files<P: Into<PathBuf>>(cert_path: P, key_path: P) -> Self
Create TLS configuration from PEM files
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TlsConfig
impl<'de> Deserialize<'de> for TlsConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TlsConfig
impl RefUnwindSafe for TlsConfig
impl Send for TlsConfig
impl Sync for TlsConfig
impl Unpin for TlsConfig
impl UnwindSafe for TlsConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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