Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

va: Support IP address identifiers #8020

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open

va: Support IP address identifiers #8020

wants to merge 30 commits into from

Conversation

jprenken
Copy link
Contributor

@jprenken jprenken commented Feb 21, 2025

Add an identifier field to the va.PerformValidationRequest proto, which will soon replace its dnsName field.

Accept and prefer the identifier field in every VA function that uses this struct. Don't (yet) assume it will be present.

Throughout the VA, accept and handle the IP address identifier type. Handling is similar to DNS names, except that getAddrs is not called, and consider that:

  • IPs are represented in a different field in the x509.Certificate struct.
  • IPs must be presented as reverse DNS (.arpa) names in SNI for TLS-ALPN-01 challenge requests.
  • IPv6 addresses are enclosed in square brackets when composing or parsing URLs.

For HTTP-01 challenges, accept redirects to bare IP addresses, which were previously rejected.

Fixes #2706
Part of #7311

⚠️ DO NOT MERGE until a CP/CPS, BR & RFC review has been performed.

@jprenken jprenken changed the title va: Use Identifier in PerformValidationRequest & support IP address identifiers va: Support IP address identifiers Feb 22, 2025
@jprenken
Copy link
Contributor Author

I've done an initial review of the Let's Encrypt CP/CPS, the Baseline Requirements, and RFC 8738. I didn't find anything that would prevent validating IP addresses using these same functions, or that would prevent accepting HTTP redirects to bare IP addresses.

@jprenken jprenken marked this pull request as ready for review February 23, 2025 06:59
@jprenken jprenken requested a review from a team as a code owner February 23, 2025 06:59
@jprenken jprenken requested a review from jsha February 23, 2025 06:59
@@ -838,51 +915,33 @@ func TestFetchHTTP(t *testing.T) {
},
},
{
Name: "Connecting to bad port",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this test. What it really tested was a doubled port: example.com:80:80. This is no longer structurally possible now that we more fully separate the port from the hostname inside the VA.

Copy link
Contributor

@aarongable aarongable left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love adding a ipv6 bool to the http and tlsalpn test srvs, but I don't see a better solution right now.

@jprenken jprenken requested a review from aarongable February 25, 2025 02:34
@jprenken jprenken requested a review from aarongable February 25, 2025 18:06
Copy link
Member

@beautifulentropy beautifulentropy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great, just a few comments to be addressed. Please let me know if you have any questions.

va/va.go Outdated
Comment on lines 681 to 686
ident, err := identifier.FromProtoOrName(req.Identifier, req.DnsName)
if err != nil {
return nil, err
}

if core.IsAnyNilOrZero(req, ident, req.Challenge, req.Authz, req.ExpectedKeyAuthorization) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here an elsewhere, I would expect these two to be swapped. First we want to check that the request we received contained all of the required fields, then we want to validate those fields and perform the necessary conversions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd gotten some feedback about this structure that I think is mildly conflicting: #7961 (comment)

But I've reworked FromProtoOrName to be simpler (and also more closely track the other PR's approach) and added TODOs to these call sites that will let us restore this order pretty shortly. Did this end up looking OK, or would you still prefer a re-order here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement RFC 8738: ACME IP Identifier Validation
3 participants