| Crates.io | rustls-config-stream |
| lib.rs | rustls-config-stream |
| version | 0.2.0 |
| created_at | 2025-09-18 07:19:38.587171+00 |
| updated_at | 2025-09-19 21:54:11.325347+00 |
| description | Async stream backed Rustls ServerConfig and ClientConfig providers for cert/root hot-reload |
| homepage | |
| repository | https://github.com/dsykes16/rustls-config-stream |
| max_upload_size | |
| id | 1844336 |
| size | 74,707 |
[rustls::ServerConfig] and [rustls::ClientConfig] providers backed async streams.
This module exposes a [ServerConfigProvider] and [ClientConfigProvider].
Both function identically, holding the current config in an
ArcSwap, providing a get_config() method to load the
current config as a standard Arc, and storing a new config
when it arrives from a user-supplied stream via a [ServerConfigStreamBuilder]
or [ClientConfigStreamBuilder].
The background task performs exponential backoff (10ms -> 10s, doubling) when the stream fails, and attempts to re-create the stream via the builder.
ServerConfigStreamBuilder] to produce a stream of fresh
ServerConfig instances (e.g. reading from disk, a secret store, or
watching a certificate manager).ServerConfigProvider::start].ServerConfigProvider::get_config] wherever you need the current
config (e.g. inside an acceptor loop).ServerConfigProvider::stream_healthy].ClientConfigProvider] works identically, only for [rustls::ClientConfig]
instead of [rustls::ServerConfig].If the tracing feature is enabled, the provider will emit diagnostics
(debug/info/error) about updates and reconnection attempts.