Skip to content

Commit

Permalink
Fix: TXT content must be unquoted
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicatoscani committed Dec 7, 2023
1 parent 9419eb9 commit 7f62168
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion solver.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"os"
"strconv"
"strings"

"github.com/cert-manager/cert-manager/pkg/acme/webhook/apis/acme/v1alpha1"
Expand Down Expand Up @@ -136,9 +137,11 @@ func (c *ExoscaleSolver) CleanUp(ch *v1alpha1.ChallengeRequest) error {

recordName := strings.TrimSuffix(strings.TrimSuffix(ch.ResolvedFQDN, ch.ResolvedZone), ".")
for _, record := range records {
// we must unquote TXT records as we receive "\"123d==\"" when we expect "123d=="
content, _ := strconv.Unquote(*record.Content)
if *record.Type == recordTypeTXT &&
*record.Name == recordName &&
*record.Content == ch.Key {
content == ch.Key {
return client.DeleteDNSDomainRecord(ctx, config.APIZone, *domain.ID, &record)
}
}
Expand Down

0 comments on commit 7f62168

Please sign in to comment.