ASP.NET Core

ASP.NET Core – KestrelServer using wrong development SSL certificate

0 min read

I recently was playing around with the localhost SSL certificate that is used with Kestrel when developing locally. After cleaning my certificate using dotnet dev-certs https --clean and then retrusting it through dotnet dev-certs https --trust, my browser kept telling me my certificate was expired. Adding more log to my application, it was telling me it was using a certificate with thumbnail X that I couldn’t find in my User Certificate Store.

Low and behold, this happens, when you have a certificate (with the same name as your projet) lingering in the folder %APPDATA%\ASP.NET\Https. The certificates here is used in a container scenario.

Thanks to this GitHub issue that pointed me in the right direction. Hope this little post can help someone not lose their hair and time.