Skip to content

[Bug]: DNS-01 ACME validation failures do not mark challenge as invalid #1365

@aglasgall

Description

@aglasgall

Steps to Reproduce

  1. Open an ACME order against a step-ca server
  2. Answer the DNS-01 challenge for the order without properly populating DNS (or populating it with the wrong value)
  3. Wait for the server to try validation

Your Environment

  • OS - Ubuntu Jammy
  • step-ca Version - 0.24.1

Expected Behavior

The challenge should eventually transition state to INVALID

Actual Behavior

The challenge stays in PENDING state indefinitely

Additional Context

Looking at acme/challenge.go, I see that both of the failure paths in dns01Validate() pass markInvalid=false to storeError():

txtRecords, err := vc.LookupTxt("_acme-challenge." + domain)
	if err != nil {
		return storeError(ctx, db, ch, false, WrapError(ErrorDNSType, err,
			"error looking up TXT records for domain %s", domain))
	}

and

	if !found {
		return storeError(ctx, db, ch, false, NewError(ErrorRejectedIdentifierType,
			"keyAuthorization does not match; expected %s, but got %s", expectedKeyAuth, txtRecords))
	}

Either these should fail on the first go or there should be some capped (configurable?) number of retries or retry period after which validation should fail and the challenge marked as invalid.

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

I'm willing to work to fix this issue, ideally in a way that doesn't involve indefinite bikeshedding about what the retry policy should be :)

Metadata

Metadata

Assignees

Labels

bugneeds triageWaiting for discussion / prioritization by team

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions