Log a warning when using an untrusted developer certificate #42621
Conversation
adityamandaleeka
left a comment
There was a problem hiding this comment.
LGTM provided that you've confirmed it doesn't prompt when doing the trust check (I don't think it does on Windows given how IsTrusted is implemented, but just want us to be sure).
There was a problem hiding this comment.
Why are we checking this here?
CheckCertificateState was here to detect when we needed to take action to fix the certificate on Mac OS (which we might need to take again)
There was a problem hiding this comment.
Is there a reason why we can't do CheckCertificateState first on kestrel and then if that succeeds call IsTrusted(certificate)?
|
I like it. For extra points, what about adding an aka.ms link to https://docs.microsoft.com/aspnet/core/security/enforcing-ssl#trust-the-aspnet-core-https-development-certificate-on-windows-and-macos to the log message. e.g.
|
|
New warning (plus an aka.ms link that's in progress): |
8ee98c4 to
cd75fc4
Compare
Co-authored-by: James Newton-King <james@newtonking.com>
Fixes #41990
If the developer certificate is present but untrusted, today Kestrel will load it without comment:
I've added a check to ensure the certificate is trusted. Now it shows:
The second log is the same message used on mac clients when the cert isn't valid.
We do not attempt to trigger the interactive trust prompt from Kestrel.