-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[Platform] Provide a better error message when the developer certificate can't be used #16659
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
[Platform] Provide a better error message when the developer certificate can't be used #16659
Conversation
cbf6f7c
to
8e9cc2d
Compare
8e9cc2d
to
43d59cf
Compare
src/Servers/Kestrel/Core/src/Middleware/HttpsConnectionMiddleware.cs
Outdated
Show resolved
Hide resolved
@Pilchie FYI |
src/Servers/Kestrel/Core/src/Middleware/HttpsConnectionMiddleware.cs
Outdated
Show resolved
Hide resolved
src/Servers/Kestrel/Core/src/Middleware/HttpsConnectionMiddleware.cs
Outdated
Show resolved
Hide resolved
🆙 📅 |
Co-Authored-By: Andrew Stanton-Nurse <[email protected]>
@Pilchie this is just waiting for your approval. |
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.
Doesn't have to be part of this change, but it seems like we should make the constructor of CertificateManager
private or protected if it's meant to be a singleton.
@@ -150,7 +150,7 @@ private static int CheckHttpsCertificate(CommandOption trust, IReporter reporter | |||
{ | |||
var now = DateTimeOffset.Now; | |||
var certificateManager = new CertificateManager(); |
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.
could be removed.
Approved for 3.1.0-Preview3. Thanks @javiercn |
…ate can't be used (#16659) Improves the error message Kestrel gives when the developer certificate key is not available for some reason.
…keys on Mac OS (3.0) (#17580) * [Platform] Provide a better error message when the developer certificate can't be used (#16659) Improves the error message Kestrel gives when the developer certificate key is not available for some reason. * [Platform] Add logic to dotnet-dev-certs to detect and fix certificates with inaccessible keys on Mac OS * Update the docs link
Partially addresses #15118
Long story short, Mac OS will introduce notarization for apps, which changes the identity of
dotnet.exe
with regards to the OS.That makes the keys for certs in the cert store (backed by keychain) not accessible to the app if the certificate was created with a
dotnet.exe
that was not notarized.Users upgrading to 3.1 in the future will encounter this on Mac OS and they won't get any feedback about what's going on other than a failed connection screen in the browser).
To help users in this scenario we are introducing an additional error message with instructions on what to do when we detect the developer certificate is being used for HTTPS, so that at least there is a proper error message.
We are still investigating all the ramifications of this issue, hence the "partially addresses it"