Expand description
Shared TLS materials and HTTPS serving helpers for HTTP services.
Provides:
TlsMaterials: DER-encoded cert + key pairget_or_init_tls_materials(): OnceLock-based lazy generation (self-signed or file-loaded)resolve_rustls_config(): Resolves per-service or shared TLS configserve_app(): Serves an Axum router over HTTPS or HTTP with graceful shutdown
TLS modes (set via [tls] mode):
self-signed(default) — rcgen-generated, dev/air-gapped onlyacme— automatic via RFC 8555 (Let’s Encrypt or self-hosted step-ca / Pebble)files— operator-supplied PEM paths
Structs§
- Resolved
TlsConfig - Resolve the rustls configuration for a service.
- TlsMaterials
- DER-encoded TLS certificate and private key.
Enums§
- Bound
Http Listener - A bound HTTP(S) listener retained between the bind and serve phases.
Functions§
- bind_
listener - Bind phase: a real
std::net::TcpListener::bindplusset_nonblocking. - get_
or_ init_ tls_ materials - Get or initialize the shared TLS materials.
- resolve_
rustls_ config - Resolve HTTP TLS configuration and any protocol-specific acceptor.
- serve_
app - Serve an Axum router over HTTPS (if rustls_config is Some) or plain HTTP.
- serve_
bound - Serve phase: consume a
BoundHttpListenerwith graceful shutdown.