From 7f621685de931c139c89e97e9f2fcad6ca21d358 Mon Sep 17 00:00:00 2001 From: jessicatoscani Date: Thu, 7 Dec 2023 13:48:14 +0100 Subject: [PATCH] Fix: TXT content must be unquoted --- solver.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/solver.go b/solver.go index 84c6572f..e22fccde 100644 --- a/solver.go +++ b/solver.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "os" + "strconv" "strings" "github.com/cert-manager/cert-manager/pkg/acme/webhook/apis/acme/v1alpha1" @@ -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) } }