use crate::tls::TrustStore;
use std::sync::LazyLock;
impl TrustStore {
pub fn webpki_roots() -> Self {
static WEBPKI_ROOTS: LazyLock<TrustStore> = LazyLock::new(|| {
webpki_root_certs::TLS_SERVER_ROOT_CERTS
.iter()
.fold(TrustStore::builder(), |builder, cert| {
builder.certificate_from_der(cert)
})
.build()
});
WEBPKI_ROOTS.clone()
}
}