1
0
mirror of https://github.com/go-acme/lego.git synced 2024-11-29 01:42:09 +02:00

autodns: fixes wrong zone in api call if CNAME is used (#1923)

This commit is contained in:
leonexcc 2023-05-26 22:03:23 +02:00 committed by GitHub
parent 91bda258a9
commit 9bd5890c40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -122,8 +122,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
Value: info.Value,
}}
// TODO(ldez) replace domain by FQDN to follow CNAME.
_, err := d.client.AddTxtRecords(context.Background(), domain, records)
_, err := d.client.AddTxtRecords(context.Background(), info.EffectiveFQDN, records)
if err != nil {
return fmt.Errorf("autodns: %w", err)
}
@ -142,8 +141,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
Value: info.Value,
}}
// TODO(ldez) replace domain by FQDN to follow CNAME.
if err := d.client.RemoveTXTRecords(context.Background(), domain, records); err != nil {
if err := d.client.RemoveTXTRecords(context.Background(), info.EffectiveFQDN, records); err != nil {
return fmt.Errorf("autodns: %w", err)
}