commit 2934350485f1a5f00e99d0f2f024894b5544e5cd parent e6f70722de3ce38897e68f57526ffe6de6f0d22b Author: Johann150 <johann.galle@protonmail.com> Date: Fri, 26 Mar 2021 12:48:34 +0100 add function to check for cert of a domain Diffstat:
M | src/certificates.rs | | | 6 | ++++++ |
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/certificates.rs b/src/certificates.rs @@ -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 {