#[non_exhaustive]pub struct MtlsConfig {Show 17 fields
pub ca_cert_path: PathBuf,
pub required: bool,
pub default_role: String,
pub crl_enabled: bool,
pub crl_refresh_interval: Option<Duration>,
pub crl_fetch_timeout: Duration,
pub crl_stale_grace: Duration,
pub crl_deny_on_unavailable: bool,
pub crl_end_entity_only: bool,
pub crl_allow_http: bool,
pub crl_enforce_expiration: bool,
pub crl_max_concurrent_fetches: usize,
pub crl_max_response_bytes: u64,
pub crl_discovery_rate_per_min: u32,
pub crl_max_host_semaphores: usize,
pub crl_max_seen_urls: usize,
pub crl_max_cache_entries: usize,
}Expand description
mTLS client certificate authentication configuration.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.ca_cert_path: PathBufPath to CA certificate(s) for verifying client certs (PEM format).
required: boolIf true, clients MUST present a valid certificate. If false, client certs are optional (verified if presented).
default_role: StringDefault RBAC role for mTLS-authenticated clients. The client cert CN becomes the identity name.
crl_enabled: boolEnable CRL-based certificate revocation checks using CDP URLs from the configured CA chain and connecting client certificates.
crl_refresh_interval: Option<Duration>Optional fixed refresh interval for known CRLs. When omitted, refresh
cadence is derived from nextUpdate and clamped internally.
crl_fetch_timeout: DurationTimeout for individual CRL fetches.
crl_stale_grace: DurationGrace window during which stale CRLs may still be used when refresh attempts fail.
When true, missing or unavailable CRLs cause revocation checks to fail closed.
crl_end_entity_only: boolWhen true, apply revocation checks only to the end-entity certificate.
crl_allow_http: boolAllow HTTP CRL distribution-point URLs in addition to HTTPS.
Defaults to true because RFC 5280 §4.2.1.13 designates HTTP (and
LDAP) as the canonical transport for CRL distribution points.
SSRF defense for HTTP CDPs is provided by the IP-allowlist guard
(private/loopback/link-local/multicast/cloud-metadata addresses are
always rejected), redirect=none, body-size cap, and per-host
concurrency limit – not by forcing HTTPS.
crl_enforce_expiration: boolEnforce CRL expiration during certificate validation.
crl_max_concurrent_fetches: usizeMaximum concurrent CRL fetches across all hosts. Defense in depth
against SSRF amplification: even if many CDPs are discovered, no
more than this many fetches run in parallel. Per-host concurrency
is independently capped at 1 regardless of this value.
Default: 4.
crl_max_response_bytes: u64Hard cap on each CRL response body in bytes. Fetches exceeding this
are aborted mid-stream to bound memory and prevent gzip-bomb-style
amplification. Default: 5 MiB (5 * 1024 * 1024).
crl_discovery_rate_per_min: u32Global CDP discovery rate limit, in URLs per minute. Throttles
how many new CDP URLs the verifier may admit into the fetch
pipeline across the whole process, bounding asymmetric DoS
amplification when attacker-controlled certificates carry large
CDP lists. The limit is global (not per-source-IP) in this
release; per-IP scoping is deferred to a future version because
it requires plumbing the peer SocketAddr through the verifier
hook. URLs that lose the rate-limiter race are not marked as
seen, so subsequent handshakes observing the same URL can
retry admission.
Default: 60.
crl_max_host_semaphores: usizeMaximum number of distinct hosts that may hold a CRL fetch
semaphore at any time. Requests that would grow the map beyond
this cap return McpxError::Config containing the literal
substring "crl_host_semaphore_cap_exceeded". Bounds memory
growth from attacker-controlled CDP URLs pointing at unique
hostnames. Default: 1024.
crl_max_seen_urls: usizeMaximum number of distinct URLs tracked in the “seen” set. Beyond this, additional discovered URLs are silently dropped with a rate-limited warn! log; no error surfaces. Default: 4096.
crl_max_cache_entries: usizeMaximum number of cached CRL entries. Beyond this, new successful fetches are silently dropped with a rate-limited warn! log (newest-rejected, not LRU-evicted). Default: 1024.
Trait Implementations§
Source§impl Clone for MtlsConfig
impl Clone for MtlsConfig
Source§fn clone(&self) -> MtlsConfig
fn clone(&self) -> MtlsConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more