From d8a52e85f35abed6a908371136eed51e5f4516a3 Mon Sep 17 00:00:00 2001 From: Jakub Pastuszek Date: Tue, 19 Nov 2019 10:49:53 +0000 Subject: [PATCH] support for wildcard certificates --- acmed/src/certificate.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/acmed/src/certificate.rs b/acmed/src/certificate.rs index 6a67b13..52d2910 100644 --- a/acmed/src/certificate.rs +++ b/acmed/src/certificate.rs @@ -93,7 +93,9 @@ impl Certificate { pub fn get_domain_challenge(&self, domain_name: &str) -> Result { let domain_name = domain_name.to_string(); for d in self.domains.iter() { - if d.dns == domain_name { + // strip wildcards from domain before matching + let base_domain = d.dns.trim_start_matches("*."); + if base_domain == domain_name { let c = Challenge::from_str(&d.challenge)?; return Ok(c); }