Browse Source

support for wildcard certificates

pull/11/head
Jakub Pastuszek 5 years ago
parent
commit
d8a52e85f3
  1. 4
      acmed/src/certificate.rs

4
acmed/src/certificate.rs

@ -93,7 +93,9 @@ impl Certificate {
pub fn get_domain_challenge(&self, domain_name: &str) -> Result<Challenge, Error> { pub fn get_domain_challenge(&self, domain_name: &str) -> Result<Challenge, Error> {
let domain_name = domain_name.to_string(); let domain_name = domain_name.to_string();
for d in self.domains.iter() { 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)?; let c = Challenge::from_str(&d.challenge)?;
return Ok(c); return Ok(c);
} }

Loading…
Cancel
Save