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

Add TLS-ALPN-01 Challenge Type to ACME #20943

Merged
merged 7 commits into from
Jun 7, 2023

Conversation

cipherboy
Copy link
Contributor

This adds the last missing (widely supported) challenge type to the PKI ACME instance: TLS-ALPN-01. This should allow a nicer experience for anyone using Caddy, nginx, or similar server which natively supports ACME cert issuance without reloads or modifying their HTTP router to server .well-known/acme-challenge/ from another location.

@cipherboy cipherboy added this to the 1.15 milestone Jun 1, 2023
@cipherboy cipherboy requested review from kitography, stevendpclark and a team June 1, 2023 21:12
Copy link
Contributor

@stevendpclark stevendpclark left a comment

Choose a reason for hiding this comment

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

Looks great so far, I don't have any comments beyond adding a test-case to validate this is works.

@cipherboy cipherboy force-pushed the cipherboy-add-tls-alpn-validator branch from 682269f to e2ea4a6 Compare June 2, 2023 17:30
cipherboy added 6 commits June 2, 2023 14:30
This adds support for verifying the last missing challenge type,
TLS-ALPN-01 challenges, using Go's TLS library. We wish to add this as
many servers (such as Caddy) support transparently renewing certificates
via this protocol, without influencing the contents of sites served.

Signed-off-by: Alexander Scheel <[email protected]>
Notably, while RFC 8737 is somewhat vague about what identifier types
can be validated with this protocol, it does restrict SANs to be only
DNSSans; from this, we can infer that it is not applicable for IP
typed identifiers. Additionally, since this must resolve to a specific
domain name, we cannot provision it for wildcard identifiers either.

Signed-off-by: Alexander Scheel <[email protected]>
This hacks the challenge engine to allow non-standard (non-443) ports,
letting us use a local server listener with custom implementation.

In addition to the standard test cases, we run:

 - A test with a longer chain (bad),
 - A test without a DNSSan (bad),
 - A test with a bad DNSSan (bad),
 - A test with some other SANs (bad),
 - A test without a CN (good),
 - A test without any leaf (bad), and
 - A test without the extension (bad).

Signed-off-by: Alexander Scheel <[email protected]>
Signed-off-by: Alexander Scheel <[email protected]>
@cipherboy cipherboy force-pushed the cipherboy-add-tls-alpn-validator branch from 6266457 to cc8b6d2 Compare June 2, 2023 18:30
Copy link
Contributor

@kitography kitography left a comment

Choose a reason for hiding this comment

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

This looks great!

builtin/logical/pki/acme_challenges.go Outdated Show resolved Hide resolved
builtin/logical/pki/acme_challenges_test.go Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants