add function to check for cert of a domain

This commit is contained in:
Johann150 2021-03-26 12:48:34 +01:00
parent e6f70722de
commit 2934350485
No known key found for this signature in database
GPG key ID: 9EE6577A2A06F8F1

View file

@ -206,6 +206,12 @@ impl CertStore {
Ok(Self { certs })
}
/// Checks if a certificate fitting a specific domain has been loaded.
/// The same rules about using a certificate at the level above apply.
pub fn has_domain(&self, domain: &str) -> bool {
self.certs.iter().any(|(s, _)| domain.ends_with(s))
}
}
impl ResolvesServerCert for CertStore {