1
0
mirror of https://github.com/go-acme/lego.git synced 2024-12-22 07:12:22 +02:00

inwx: delete only the TXT record related to the DNS challenge (#2373)

Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
This commit is contained in:
Jan-Henrik Bruhn 2024-12-03 19:51:37 +01:00 committed by GitHub
parent eb041044b8
commit 2c13835084
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -180,15 +180,26 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
return fmt.Errorf("inwx: %w", err)
}
var lastErr error
var recordID int
for _, record := range response.Records {
err = d.client.Nameservers.DeleteRecord(record.ID)
if err != nil {
lastErr = fmt.Errorf("inwx: %w", err)
if record.Content != challengeInfo.Value {
continue
}
recordID = record.ID
break
}
return lastErr
if recordID == 0 {
return errors.New("inwx: TXT record not found")
}
err = d.client.Nameservers.DeleteRecord(recordID)
if err != nil {
return fmt.Errorf("inwx: %w", err)
}
return nil
}
// Timeout returns the timeout and interval to use when checking for DNS propagation.