Expand description
rustls::ServerConfig provider backed by an async stream.
This module exposes a ServerConfigProvider that holds the “current”
TLS server configuration and updates it whenever a new config arrives from a
user-supplied stream (see ServerConfigStreamBuilder).
The background task performs exponential backoff (10ms -> 10s, doubling)
when the stream fails, and attempts to re-create the stream via the builder.
Call ServerConfigProvider::get_config whenever you need an Arc<ServerConfig>.
§Overview
- Implement
ServerConfigStreamBuilderto produce a stream of freshServerConfiginstances (e.g., reading from disk, a secret store, or watching a certificate manager). - Start the provider with
ServerConfigProvider::start. - Use
ServerConfigProvider::get_configwherever you need the current config (e.g., inside an acceptor loop). - Optionally monitor liveness via
ServerConfigProvider::stream_healthy.
§Tracing
If the tracing feature is enabled, the provider will emit diagnostics
(debug/info/error) about updates and reconnection attempts.
Structs§
- Server
Config Provider - Holds the current
ServerConfigand refreshes it from an async stream.
Enums§
- Server
Config Stream Error - Errors that can occur while building or consuming a server-config stream.
Traits§
- Server
Config Stream Builder - A factory for producing a stream of
rustls::ServerConfig.