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

Print warning when using certificate from %APPDATA%\ASP.NET\Https #58008

Open
1 task done
maloo opened this issue Sep 21, 2024 · 4 comments
Open
1 task done

Print warning when using certificate from %APPDATA%\ASP.NET\Https #58008

maloo opened this issue Sep 21, 2024 · 4 comments
Labels
area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI

Comments

@maloo
Copy link

maloo commented Sep 21, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

When debugging an ASP.NET Core app that has an old certificate lingering in %APPDATA%\ASP.NET\Https Kestrel picks up this certificate without any warning to user and finding this certificate is not easy since the certificate is not in the normal certificate store in Windows. Also, dotnet dev-certs command doesn't warn about or clear this certificate when using the --clean/-trust to try and fix the certificate error.

Describe the solution you'd like

At least print a Warning in the log at startup when this special certificate is used instead of the normal dev cert.
Make dotnet dev-cert command print a warning about this when checking the dev-cert status and make --clean remove it.

Additional context

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI label Sep 21, 2024
@amcasey
Copy link
Member

amcasey commented Sep 25, 2024

Since that's a supported way to specify the dev certificate, it would be hard to print a warning. We could certainly log something at Debug or possibly Information, if that would be helpful.

@amcasey
Copy link
Member

amcasey commented Sep 25, 2024

I'd be a little nervous about making dev-certs --clean delete such a certificate since it doesn't, as far as I recall, put one there. That is, it could only be deleting a certificate created by another user or tool.

Do you happen to know how that certificate ended up there?

@amcasey
Copy link
Member

amcasey commented Sep 25, 2024

And, as I suppose I should have begun, I'm sorry you were bitten by that - automatic functionality like that is frustrating to debug.

@maloo
Copy link
Author

maloo commented Sep 26, 2024

Anything you could do would be great. Right now it is terrible user experience. Printing Debjg/Info would be great. Having dev-certs warn you would be great. Add a warning in docs would be great.

Not sure where I got it from, I think it is related to IIS. In general I think it would be good if kestrel would print Info/Debug about what cert it picked for an endpoint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI
Projects
None yet
Development

No branches or pull requests

2 participants