Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Aaron Gable <aaron@aarongable.com>
  • Loading branch information
sheurich and aarongable committed Mar 13, 2024
1 parent e668574 commit 25c0824
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions va/va.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,7 @@ func (va VAImpl) validateDNSAccount01(task *vaTask) *core.ValidationRecord {
if task.Wildcard {
scope = "wildcard"
}
challengeSubdomain := "_" + acctLabel +
"._acme-" + scope + "-challenge." + task.Identifier.Value
challengeSubdomain := fmt.Sprintf("_%s._acme-%s-challenge.%s", acctLabel, scope, task.Identifier.Value)

result := &core.ValidationRecord{
URL: challengeSubdomain,
Expand All @@ -366,12 +365,12 @@ func (va VAImpl) validateDNSAccount01(task *vaTask) *core.ValidationRecord {

txts, err := va.getTXTEntry(challengeSubdomain)
if err != nil {
result.Error = acme.UnauthorizedProblem(fmt.Sprintf("Error retrieving TXT records for DNS challenge (%q)", err))
result.Error = acme.UnauthorizedProblem(fmt.Sprintf("Error retrieving TXT records for DNS-ACCOUNT-01 challenge (%q)", err))
return result
}

if len(txts) == 0 {
msg := "No TXT records found for DNS challenge"
msg := "No TXT records found for DNS-ACCOUNT-01 challenge"
result.Error = acme.UnauthorizedProblem(msg)
return result
}
Expand All @@ -388,7 +387,7 @@ func (va VAImpl) validateDNSAccount01(task *vaTask) *core.ValidationRecord {
}
}

msg := "Correct value not found for DNS challenge"
msg := "Correct value not found for DNS-ACCOUNT-01 challenge"
result.Error = acme.UnauthorizedProblem(msg)
return result
}
Expand Down

0 comments on commit 25c0824

Please sign in to comment.