mirror of
https://github.com/go-acme/lego.git
synced 2025-02-16 09:21:39 +02:00
cname: stop trying to traverse cname if none have been found (#1733)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
This commit is contained in:
parent
79fcc56402
commit
5e37ee3822
@ -194,14 +194,18 @@ func getChallengeFqdn(domain string) string {
|
||||
// Keep following CNAMEs
|
||||
r, err := dnsQuery(fqdn, dns.TypeCNAME, recursiveNameservers, true)
|
||||
|
||||
// Check if the domain has CNAME then use that
|
||||
if err == nil && r.Rcode == dns.RcodeSuccess {
|
||||
fqdn = updateDomainWithCName(r, fqdn)
|
||||
continue
|
||||
if err != nil || r.Rcode != dns.RcodeSuccess {
|
||||
// No more CNAME records to follow, exit
|
||||
break
|
||||
}
|
||||
|
||||
// No more CNAME records to follow, exit
|
||||
break
|
||||
// Check if the domain has CNAME then use that
|
||||
cname := updateDomainWithCName(r, fqdn)
|
||||
if cname == fqdn {
|
||||
break
|
||||
}
|
||||
|
||||
fqdn = cname
|
||||
}
|
||||
|
||||
return fqdn
|
||||
|
Loading…
x
Reference in New Issue
Block a user