pub struct RotatingTlsConfig { /* private fields */ }Expand description
Hot-Reload-fähiger Wrapper um Arc<ServerConfig>. Zwischen Reads
(neue Connections lesen frisch) und Writes (SIGHUP-Reload tauscht
das Inner-Arc aus) ist ein RwLock die natürliche Form.
Connections, die zum Reload-Zeitpunkt schon einen Arc<ServerConfig>
halten, behalten ihren Cert für die Session. Neue Connections nach
dem Reload sehen den neuen Cert — das ist die Spec-konforme Semantik
(SIGHUP rotiert nur zukünftige Sessions, kein Forced-Renegotiation).
Implementations§
Source§impl RotatingTlsConfig
impl RotatingTlsConfig
Sourcepub fn load(
cert_path: PathBuf,
key_path: PathBuf,
client_ca_path: Option<PathBuf>,
) -> Result<Self, TlsConfigError>
pub fn load( cert_path: PathBuf, key_path: PathBuf, client_ca_path: Option<PathBuf>, ) -> Result<Self, TlsConfigError>
Lädt initial Cert+Key (optional Client-CA für mTLS) und gibt einen rotierbaren Wrapper zurück.
§Errors
TlsConfigError bei Lade-/Build-Fehler.
Sourcepub fn current(&self) -> Arc<ServerConfig>
pub fn current(&self) -> Arc<ServerConfig>
Holt den aktuellen Arc<ServerConfig> für eine neue Connection.
Block-frei beim Read-Lock-Fast-Path; bei Reload-Konflikt
blockiert read() kurz auf den RwLock.
Sourcepub fn reload(&self) -> Result<(), TlsConfigError>
pub fn reload(&self) -> Result<(), TlsConfigError>
SIGHUP-Hook: Lädt Cert+Key neu von Disk und tauscht den
gespeicherten Arc atomisch aus.
§Errors
TlsConfigError bei Lade-/Build-Fehler. Beim Fehler bleibt
der bestehende Cert aktiv (no-op).
Trait Implementations§
Source§impl Clone for RotatingTlsConfig
impl Clone for RotatingTlsConfig
Source§fn clone(&self) -> RotatingTlsConfig
fn clone(&self) -> RotatingTlsConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more