(
validator: Arc<dyn CertValidator>,
ca_cert_der: CertificateDer<'static>,
)
| 56 | |
| 57 | impl CustomCertVerifier { |
| 58 | fn new( |
| 59 | validator: Arc<dyn CertValidator>, |
| 60 | ca_cert_der: CertificateDer<'static>, |
| 61 | ) -> Result<Self> { |
| 62 | let mut root_store = rustls::RootCertStore::empty(); |
| 63 | root_store |
| 64 | .add(ca_cert_der) |
| 65 | .context("failed to add CA cert to root store")?; |
| 66 | Ok(Self { |
| 67 | validator, |
| 68 | root_store: Arc::new(root_store), |
| 69 | }) |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | impl ServerCertVerifier for CustomCertVerifier { |