Skip to content

Commit 79baa78

Browse files
Prepare pebble-challtestsrv for DNS-persist challenge support (#535)
Prepare challtestsrv for the addition of a new DNS-based challenge method, [draft-ietf-acme-dns-persist](https://datatracker.ietf.org/doc/html/draft-ietf-acme-dns-persist-00). Overall functionality is unchanged aside from the API changes documented below; these changes are purely terminology updates and code reorganization. Update challtestsrv to v1.4.1, a tag that includes letsencrypt/challtestsrv#32. In pebble-challtestsrv, merge dnsone.go and mockdns.go into dns.go, and rename DNS-01-specific functions to the more generic DNS*. Rename the `-dns01` flag to `-dnsserver`, matching the same flag in Pebble. Also, remove any mention of mock, mocks, and mocked in the dns.go doc comments and README.
1 parent fcc2230 commit 79baa78

18 files changed

Lines changed: 545 additions & 534 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Afterwards you can access the ACME API from your host machine at
107107
at `https://localhost:15000` and the `pebble-challtestsrv`'s management
108108
interface at `http://localhost:8055`.
109109

110-
To get started you may want to update the `pebble-challtestsrv` mock DNS data
110+
To get started you may want to update the `pebble-challtestsrv` DNS data
111111
with a new default IPv4 address to use to respond to `A` queries from `pebble`:
112112

113113
```
@@ -199,8 +199,8 @@ pebble -dnsserver :5053
199199
```
200200

201201
You may find it useful to set `pebble`'s `-dnsserver` to the address you used as
202-
the `-dns01` argument when starting up a `pebble-challtestsrv` instance. This
203-
will let you easily mock DNS data for Pebble. See the included
202+
the `-dnsserver` argument when starting up a `pebble-challtestsrv` instance. This
203+
will let you easily serve DNS data for Pebble. See the included
204204
`docker-compose.yml` and the [pebble-challtestsrv
205205
README](https://github.com/letsencrypt/pebble/blob/master/cmd/pebble-challtestsrv/README.md)
206206
for more information.

cmd/pebble-challtestsrv/README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ redirect behaviour for HTTP-01 challenge validation.
1717
```
1818
Usage of pebble-challtestsrv:
1919
-defaultIPv4 string
20-
Default IPv4 address for mock DNS responses to A queries (default "127.0.0.1")
20+
Default IPv4 address for DNS responses to A queries (default "127.0.0.1")
2121
-defaultIPv6 string
22-
Default IPv6 address for mock DNS responses to AAAA queries (default "::1")
23-
-dns01 string
24-
Comma separated bind addresses/ports for DNS-01 challenges and fake DNS data. Set empty to disable. (default ":8053")
22+
Default IPv6 address for DNS responses to AAAA queries (default "::1")
23+
-dnsserver string
24+
Comma separated bind addresses/ports for serving DNS queries. Set empty to disable. (default ":8053")
2525
-http01 string
2626
Comma separated bind addresses/ports for HTTP-01 challenges. Set empty to disable. (default ":5002")
2727
-https01 string
@@ -34,43 +34,43 @@ Usage of pebble-challtestsrv:
3434

3535
To disable a challenge type, set the bind address to `""`. E.g.:
3636

37-
* To run HTTP-01 only: `pebble-challtestsrv -https01 "" -dns01 "" -tlsalpn01 ""`
38-
* To run HTTPS-01 only: `pebble-challtestsrv -http01 "" -dns01 "" -tlsalpn01 ""`
37+
* To run HTTP-01 only: `pebble-challtestsrv -https01 "" -dnsserver "" -tlsalpn01 ""`
38+
* To run HTTPS-01 only: `pebble-challtestsrv -http01 "" -dnsserver "" -tlsalpn01 ""`
3939
* To run DNS-01 only: `pebble-challtestsrv -http01 "" -https01 "" -tlsalpn01 ""`
40-
* To run TLS-ALPN-01 only: `pebble-challtestsrv -http01 "" -https01 "" -dns01 ""`
40+
* To run TLS-ALPN-01 only: `pebble-challtestsrv -http01 "" -https01 "" -dnsserver ""`
4141

4242
### Management Interface
4343

4444
_Note: These examples assume the default `-management` interface address, `:8055`._
4545

46-
#### Mock DNS
46+
#### DNS
4747

4848
##### Default A/AAAA Responses
4949

5050
You can set the default IPv4 and IPv6 addresses used for `A` and `AAAA` query
5151
responses using the `-defaultIPv4` and `-defaultIPv6` command line flags.
5252

5353
To change the default IPv4 address used for responses to `A` queries that do not
54-
match explicit mocks at runtime run:
54+
match explicit records at runtime, run:
5555

5656
curl -d '{"ip":"10.10.10.2"}' http://localhost:8055/set-default-ipv4
5757

5858
Similarly to change the default IPv6 address used for responses to `AAAA` queries
59-
that do not match explicit mocks run:
59+
that do not match explicit records, run:
6060

6161
curl -d '{"ip":"::1"}' http://localhost:8055/set-default-ipv6
6262

6363
To clear the default IPv4 or IPv6 address POST the same endpoints with an empty
6464
(`""`) IP.
6565

66-
##### Mocked A/AAAA Responses
66+
##### A/AAAA Responses
6767

6868
To add IPv4 addresses to be returned for `A` queries for
6969
`test-host.letsencrypt.org` run:
7070

7171
curl -d '{"host":"test-host.letsencrypt.org", "addresses":["12.12.12.12", "13.13.13.13"]}' http://localhost:8055/add-a
7272

73-
The mocked `A` responses can be removed by running:
73+
The `A` responses can be removed by running:
7474

7575
curl -d '{"host":"test-host.letsencrypt.org"}' http://localhost:8055/clear-a
7676

@@ -79,38 +79,38 @@ To add IPv6 addresses to be returned for `AAAA` queries for
7979

8080
curl -d '{"host":"test-host.letsencrypt.org", "addresses":["2001:4860:4860::8888", "2001:4860:4860::8844"]}' http://localhost:8055/add-aaaa
8181

82-
The mocked `AAAA` responses can be removed by running:
82+
The `AAAA` responses can be removed by running:
8383

8484
curl -d '{"host":"test-host.letsencrypt.org"}' http://localhost:8055/clear-aaaa
8585

86-
##### Mocked CAA Responses
86+
##### CAA Responses
8787

88-
To add a mocked CAA policy for `test-host.letsencrypt.org` that allows issuance
88+
To add a CAA policy for `test-host.letsencrypt.org` that allows issuance
8989
by `letsencrypt.org` run:
9090

9191
curl -d '{"host":"test-host.letsencrypt.org", "policies":[{"tag":"issue","value":"letsencrypt.org"}]}' http://localhost:8055/add-caa
9292

93-
To remove the mocked CAA policy for `test-host.letsencrypt.org` run:
93+
To remove the CAA policy for `test-host.letsencrypt.org` run:
9494

9595
curl -d '{"host":"test-host.letsencrypt.org"}' http://localhost:8055/clear-caa
9696

97-
##### Mocked CNAME Responses
97+
##### CNAME Responses
9898

99-
To add a mocked CNAME record for `_acme-challenge.test-host.letsencrypt.org` run:
99+
To add a CNAME record for `_acme-challenge.test-host.letsencrypt.org` run:
100100

101101
curl -d '{"host":"_acme-challenge.test-host.letsencrypt.org", "target": "challenges.letsencrypt.org"}' http://localhost:8055/set-cname
102102

103-
To remove a mocked CNAME record for `_acme-challenge.test-host.letsencrypt.org` run:
103+
To remove a CNAME record for `_acme-challenge.test-host.letsencrypt.org` run:
104104

105105
curl -d '{"host":"_acme-challenge.test-host.letsencrypt.org", "target": "challenges.letsencrypt.org"}' http://localhost:8055/clear-cname
106106

107-
##### Mocked SERVFAIL Responses
107+
##### SERVFAIL Responses
108108

109109
To configure the DNS server to return SERVFAIL for all queries for `test-host.letsencrypt.org` run:
110110

111111
curl -d '{"host":"test-host.letsencrypt.org"}' http://localhost:8055/set-servfail
112112

113-
Subsequently any query types (A, AAAA, TXT) for the name will return a SERVFAIL response, overriding any A/AAAA/TXT/CNAME mocks that may also be configured.
113+
Subsequently any query types (A, AAAA, TXT) for the name will return a SERVFAIL response, overriding any configured A/AAAA/TXT/CNAME records.
114114

115115
To remove the SERVFAIL configuration for `test-host.letsencrypt.org` run:
116116

@@ -153,7 +153,7 @@ the value `"foo"` run:
153153

154154
curl -d '{"host":"_acme-challenge.test-host.letsencrypt.org.", "value": "foo"}' http://localhost:8055/set-txt
155155

156-
To remove the mocked DNS-01 challenge response run:
156+
To remove the DNS-01 challenge response run:
157157

158158
curl -d '{"host":"_acme-challenge.test-host.letsencrypt.org."}' http://localhost:8055/clear-txt
159159

@@ -166,7 +166,7 @@ To add a TLS-ALPN-01 challenge response certificate for the host
166166

167167
curl -d '{"host":"test-host.letsencrypt.org", "content":"foo"}' http://localhost:8055/add-tlsalpn01
168168

169-
To remove the mocked TLS-ALPN-01 challenge response run:
169+
To remove the TLS-ALPN-01 challenge response run:
170170

171171
curl -d '{"host":"test-host.letsencrypt.org"}' http://localhost:8055/del-tlsalpn01
172172

0 commit comments

Comments
 (0)