Skip to content

Commit d9d2f4e

Browse files
authored
VA: Simplified HTTP-01 w/ IP address URLs (#3939)
Continued bugs from the custom dialer approach used by the VA for HTTP-01 (most recently #3889) motivated a rewrite. Instead of using a custom dialer to be able to control DNS resolution for HTTP validation requests we can construct URLs for the IP addresses we resolve and overload the Host header. This avoids having to do address resolution within the dialer and eliminates the complexity of the dialer `addrInfoChan`. The only thing left for our custom dialer now is to shave some time off of the provided context to help us discern timeouts before/after connect. The existing IP preference & fallback behaviour is preserved: e.g. if a host has both IPv6 and IPv4 addresses we connect to the first IPv6 address. If there is a network error connecting to that address (e.g. an error during "dial"), we try once more with the first IPv4 address. No other retries are done. Matching existing behaviour no fallback is done for HTTP level failures on an IPv6 address (e.g. mismatched webroots, redirect loops, etc). A new Prometheus counter "http01_fallbacks" is used to keep track of the number of fallbacks performed. As a result of moving the layer at which the retry happens a fallback like described above will now produce two validation records: one for the initial IPv6 connection, and one for the IPv4 connection. Neither will have the "addressesTried" field populated, just "addressesResolved" and "addressUsed". Previously with the dialer doing the retry we would have created just one validation record with an IPv4 "addressUsed" field and both an IPv6 and IPv4 address in the "addressesTried" field. Because this is a big diff for a key part of the VA the new code is gated by the `SimplifiedVAHTTP` feature flag. Resolves #3889
1 parent c92bf8c commit d9d2f4e

8 files changed

Lines changed: 1337 additions & 6 deletions

File tree

features/featureflag_string.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

features/features.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ const (
3838
ACME13KeyRollover
3939
// ProbeCTLogs enables HTTP probes to CT logs from the publisher
4040
ProbeCTLogs
41+
// SimplifiedVAHTTP enables the simplified VA http-01 rewrite that doesn't use
42+
// a custom dialer.
43+
SimplifiedVAHTTP
4144
)
4245

4346
// List of features and their default value, protected by fMu
@@ -62,6 +65,7 @@ var features = map[FeatureFlag]bool{
6265
CAAAccountURI: false,
6366
ACME13KeyRollover: false,
6467
ProbeCTLogs: false,
68+
SimplifiedVAHTTP: false,
6569
}
6670

6771
var fMu = new(sync.RWMutex)

test/config-next/va-remote-a.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"RPCHeadroom": true,
3131
"IPv6First": true,
3232
"CAAValidationMethods": true,
33-
"CAAAccountURI": true
33+
"CAAAccountURI": true,
34+
"SimplifiedVAHTTP": true
3435
},
3536
"accountURIPrefixes": [
3637
"http://boulder:4000/acme/reg/"

test/config-next/va-remote-b.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"RPCHeadroom": true,
3131
"IPv6First": true,
3232
"CAAValidationMethods": true,
33-
"CAAAccountURI": true
33+
"CAAAccountURI": true,
34+
"SimplifiedVAHTTP": true
3435
},
3536
"accountURIPrefixes": [
3637
"http://boulder:4000/acme/reg/"

test/config-next/va.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"VAChecksGSB": true,
3737
"IPv6First": true,
3838
"CAAValidationMethods": true,
39-
"CAAAccountURI": true
39+
"CAAAccountURI": true,
40+
"SimplifiedVAHTTP": true
4041
},
4142
"remoteVAs": [
4243
{

0 commit comments

Comments
 (0)