Browse Source
Merge pull request #11 from jpastuszek/wildcard_certs
support for wildcard certificates
pull/19/head
Rodolphe Bréard
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
1 deletions
-
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);
|
|
|
}
|
|
|
}
|
|
|