trz_gateway_common/security_configuration/trusted_store/
native.rs

1use std::convert::Infallible;
2use std::sync::Arc;
3
4use openssl::x509::store::X509Store;
5
6use super::TrustedStoreConfig;
7use crate::x509::native_roots::native_roots;
8
9/// The [TrustedStoreConfig] for certificates trusted by the OS.
10#[derive(Clone, Copy, Debug, PartialEq, Eq)]
11pub struct NativeTrustedStoreConfig;
12
13impl TrustedStoreConfig for NativeTrustedStoreConfig {
14    type Error = Infallible;
15    fn root_certificates(&self) -> Result<Arc<X509Store>, Self::Error> {
16        Ok(native_roots().clone())
17    }
18}