pub enum TrustStore {
NativeWithWebPkiFallback,
NativeOnly,
WebPkiOnly,
Custom(Vec<CertificateDer<'static>>),
}Expand description
Trust store source for certificate verification.
Variants§
NativeWithWebPkiFallback
Use native system roots with packaged WebPKI roots as a construction
fallback when tls-native-roots is enabled. Without that feature, the
default builder uses packaged WebPKI roots directly.
When native loading fails, construction succeeds on WebPKI roots.
Per-path causes are emitted only via tracing::warn with feature
tracing; without it the substitution is silent. Callers who must
detect the fallback should build with TrustStore::NativeOnly,
which fails closed, or enable tracing.
NativeOnly
Use only native system roots. Fails at construction if the platform root store is unavailable.
WebPkiOnly
Use only packaged Mozilla/WebPKI roots. Does not consult the operating system trust store.
Custom(Vec<CertificateDer<'static>>)
Use the provided CA certificates as the sole trust anchor. These replace all other roots.