pub enum TrustRoots {
Platform,
Bundled,
}Expand description
Which certificate roots verify a server’s TLS certificate.
Verification is always on; there is no option that turns it off. Platform hands the
decision to the operating system (macOS Security framework, Windows CryptoAPI, the
system roots on Linux) through rustls-platform-verifier in both clients, so roots an
enterprise or an inspection proxy installed on the machine are honoured, as curl and
browsers honour them.
Variants§
Platform
The operating system’s trust store. This is the default. When the store cannot be
used the client fails closed: the handshake (blocking) or AsyncClient::new (async)
returns an error.
Bundled
Mozilla’s root certificates compiled into the crate (webpki-roots), ignoring the
machine’s store. Use it when the machine’s roots must not be trusted, or when
results must not depend on the machine. A host behind TLS inspection will fail.
Implementations§
Source§impl TrustRoots
impl TrustRoots
Sourcepub fn verifier_kind(self) -> &'static str
pub fn verifier_kind(self) -> &'static str
"platform" or "bundled": the verifier a client built from this setting uses.