-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add Subject Key Identifier and Authority Key Identifier extensions to the generated dev cert #64263
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
Conversation
… the generated dev cert
|
Example certificate extensions with this change: |
| internal const int CurrentAspNetCoreCertificateVersion = 5; | ||
| internal const int CurrentMinimumAspNetCoreCertificateVersion = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to state this out loud so we're all clear, I believe this means that after getting this change in a patch on a dev machine, ASP.NET Core apps will now require version 5 of the cert to be present. However it won't be created/installed until something forces the SDK first-run experience to run (e.g. running a dotnet command) or dotnet dev-certs https is run explicitly. I think this is what we want TBC, but want to ensure we're all on the same page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances ASP.NET Core's HTTPS development certificate generation by adding Subject Key Identifier (SKI) and Authority Key Identifier (AKI) extensions to self-signed certificates, bringing them into compliance with RFC 5280 recommendations. The certificate version is bumped from 4 to 5 to reflect this structural change.
Key changes:
- Adds SKI and AKI extensions to generated self-signed certificates per RFC 5280 sections 4.2.1.2 and 4.2.1.1
- Increments certificate version constants from 4 to 5
- Minor whitespace cleanup
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
bartonjs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are always welcome, but the technical change LGTM.
|
/backport to release/10.0 |
|
Started backporting to |
Add Subject Key Identifier and Authority Key Identifier extensions to the generated dev cert
Add Subject Key Identifier and Authority Key Identifier extensions to the dev cert
Description
Adds the Subject Key Identifier (SKID) and Authority Key Identifier (AKID) extensions to the dev cert to resolve issues with OpenSSL. Additionally increases the certificate version from 4 to 5 to ensure the certificate will be refreshed after a user updates.
OpenSSL uses the SKID and AKID extensions to identify the correct trust chain for a private key (even for a single trusted root certificate like the dev cert). If multiple certificates have the same SKID (or don't have an SKID value) and share the same subject, then the incorrect public certificate may be selected to verify the key, resulting in OpenSSL verification failures.
Fixes #64261