Expand description
rustls-native-certs allows rustls to use the platform’s native certificatestore when operating as a TLS client.
It provides a single functionload_native_certs()
, which returns acollection of certificates found by reading the platform-nativecertificate store.
If the SSL_CERT_FILE environment variable is set, certificates (in PEMformat) are read from that file instead.
If you want to load these certificates into arustls::RootCertStore
,you’ll likely want to do something like this:
letmutroots = rustls::RootCertStore::empty();forcertinrustls_native_certs::load_native_certs().expect("could not load platform certs") { roots.add(cert).unwrap();}
Structs§
- Certificate
Result - Results from trying to load certificates from the platform’s native store.
- Error
Enums§
Functions§
- load_
native_ certs - Load root certificates found in the platform’s native certificate store.