Skip to content

Commit 3e531d5

Browse files
Small change to various validation errors
1 parent bcf9af7 commit 3e531d5

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

va/va.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ func (va VAImpl) validateDNSPersist01(task *vaTask) *core.ValidationRecord {
667667
txtRecords, err := va.getTXTEntry(challengeSubdomain)
668668
if err != nil {
669669
result.Error = acme.UnauthorizedProblem(
670-
fmt.Sprintf("Error retrieving TXT records for DNS-PERSIST-01 challenge (%q)", err))
670+
fmt.Sprintf("Error retrieving TXT records for DNS-PERSIST-01 challenge: %s", err))
671671
return result
672672
}
673673

@@ -693,31 +693,31 @@ func (va VAImpl) validateDNSPersist01(task *vaTask) *core.ValidationRecord {
693693
// we can continue checking other records but we should report the
694694
// syntax error if no other record authorizes the challenge.
695695
syntaxErrs = append(syntaxErrs, fmt.Sprintf(
696-
"error parsing TXT record with issuer-domain-name %q for DNS-PERSIST-01 challenge: %q", issuerDomainName, err))
696+
"Error parsing DNS-PERSIST-01 challenge TXT record with issuer-domain-name %q: %s", issuerDomainName, err))
697697
continue
698698
}
699699
if issueValue.accountURI == "" {
700700
syntaxErrs = append(syntaxErrs, fmt.Sprintf(
701-
"error parsing TXT record with issuer-domain-name %q for DNS-PERSIST-01 challenge: missing mandatory accountURI parameter", issuerDomainName))
701+
"Error parsing DNS-PERSIST-01 challenge TXT record with issuer-domain-name %q: missing mandatory accountURI parameter", issuerDomainName))
702702
continue
703703
}
704704
if issueValue.accountURI != task.AccountURL {
705705
authorizationErrs = append(authorizationErrs, fmt.Sprintf(
706-
"error parsing TXT record with issuer-domain-name %q for DNS-PERSIST-01 challenge: accounturi mismatch: expected %q, got %q",
706+
"Error parsing DNS-PERSIST-01 challenge TXT record with issuer-domain-name %q: accounturi mismatch: expected %q, got %q",
707707
issuerDomainName, task.AccountURL, issueValue.accountURI))
708708
continue
709709
}
710710
// Per the dns-persist-01 specification, if the policy tag is present
711711
// parameter's defined values MUST be treated as case-insensitive.
712712
if task.Wildcard && strings.ToLower(issueValue.policy) != "wildcard" {
713713
authorizationErrs = append(authorizationErrs, fmt.Sprintf(
714-
"error parsing TXT record with issuer-domain-name %q for DNS-PERSIST-01 challenge: policy mismatch: expected \"wildcard\", got %q",
714+
"Error parsing DNS-PERSIST-01 challenge TXT record with issuer-domain-name %q: policy mismatch: expected \"wildcard\", got %q",
715715
issuerDomainName, issueValue.policy))
716716
continue
717717
}
718718
if issueValue.persistUntil != nil && result.ValidatedAt.After(*issueValue.persistUntil) {
719719
authorizationErrs = append(authorizationErrs, fmt.Sprintf(
720-
"error parsing TXT record with issuer-domain-name %q for DNS-PERSIST-01 challenge: persistUntil expired: validation time %s is after persistUntil %s",
720+
"Error parsing DNS-PERSIST-01 challenge TXT record with issuer-domain-name %q, validation time %s is after persistUntil %s",
721721
issuerDomainName, result.ValidatedAt.Format(time.RFC3339), issueValue.persistUntil.Format(time.RFC3339)))
722722
continue
723723
}

va/va_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ func TestValidateDNSPersist01(t *testing.T) {
317317
challTXTRecords: []string{"authority.example;accounturi=https://ca.example/acct/123;persistUntil=1"},
318318
expectErr: true,
319319
expectHTTPStatus: 403,
320-
expectDetailSubstr: `persistUntil expired: validation time`,
320+
expectDetailSubstr: `validation time`,
321321
},
322322
}
323323

0 commit comments

Comments
 (0)