Go's ListenAndServe methods return an error with the text "Server
close", even on a clean shutdown. We should suppress this spurious error
so it doesn't mask more meaningful ones.
Also, update to a more recent golangci-lint and exempt some lints in order
to fix the build.
This PR breaks API compatibility by renaming the exported `IdPeAcmeIdentifier` field to `IDPeAcmeIdentifier`.
I'll cut a new major release the next time something beyond tidying up comes along.
Its useful for testing purposes to be able to find out what requests have been processed by the challenge test servers.
For example it may be useful to see that redirects were properly followed or that CAA tree climbing resulted in the expected DNS queries.
Fix some style/clarity things in the comments.
Also, remove the "if" guards around several delete statements. The
delete builtin is a no-op if the field doesn't exist, so we don't need
those guards.
Boulder has a nice handy [`challtestsrv` package and command][1] used for integration tests.
It's small, stand-alone, and useful enough to live in its own repo. This will make it
easy for Boulder's load-generator to use the common package and for Pebble's
pebble-challtestsrv command to use it as well.
The `challtestsrv` package is ported over from Boulder mostly-as is with a few
small improvements. Notably:
* The TLS-ALPN-01 and HTTPS HTTP-01 features were split into two separate binds.
This helps us preserve strict TLS-ALPN-01 challenge responses while also supporting
HTTP-01 -> HTTPS HTTP-01 redirects. (See https://github.com/letsencrypt/boulder/issues/3962)
* The "FAKE_DNS" env var is removed. Now there is a default IPv4 and a default
IPv6 address that can be set via the management API. These default addresses are
used for A/AAAA query responses when there is not a more specific mock.
* Hardcoded Boulder specific mock DNS data is removed. In its place are new
management API functions for adding/removing mock A, AAAA, and CAA records
* The output is less noisy now. The DNS server no longer prints a line per reply.
[1]: 9e39680e3f/test/challtestsrv
Boulder has a nice handy [`challtestsrv` package and
command](9e39680e3f/test/challtestsrv)
used for integration tests. Its small and useful enough to live in its
own repo. This will make it easy for Boulder's load-generator to use the
common package and for Pebble's pebble-challtestsrv command to use it as
well.
The `challtestsrv` package is ported over from Boulder mostly-as is with
a few small improvements. Notably:
* The TLS-ALPN-01 and HTTPS HTTP-01 features were split into two
separate binds. This helps us preserve strict TLS-ALPN-01 challenge
responses while also supporting HTTP-01 -> HTTPS HTTP-01 redirects. (See
https://github.com/letsencrypt/boulder/issues/3962)
* The "FAKE_DNS" env var is removed. Now there is a default IPv4 and
a default IPv6 address that can be set via the management API. These
default addresses are used for A/AAAA query responses when there is not
a more specific mock.
* Hardcoded Boulder specific mock DNS data is removed. In its place are
new management API functions for adding/removing mock A, AAAA, and CAA
records
* The output is less noisy now. The DNS server no longer prints a line
per reply.