Something strange is suddenly happening with the localhost SSL cert when developing on my local pc. I am using a freshly installed VS 2022 enabled for asp.net web development.
When I use the New Project wizard to create a very basic C# ASP.NET Core Web App and select the “Configure for HTTPS” checkbox the project is is created and builds fine.
When I Debug the app I am asked to create and trust a new cert for localhost – as expected – which I can then see in my Windows Personal Certificates folder.
All fine so far.
Except when the browser comes at the app appdress (https://localhost:7076/ in this case) there is no cert attached to the site at all. Of course the browser complains the site is not secure.
This issue happens whether I use the ASP.NET Development Server or IIS Express. Both have the same problem. Its like they do not know to bind the cert to the running app?
All help appreciated!
KR
Bill
I created and debugged a basic ASP.NET Core web application from the VS 2022 template.
I expcted a localhost cert to be created which it was.
I expected this cert to be applied to the app when I ran it in debug mode. But no cert is attached.
“browser complains the site is not secure” – this is a simplified interpretation of what you actually experience. What exactly do you see, what is the exact error message you get?
Hi Steffen. Thanks for your time. As I said above the site has no cert attached. I have added a screenshot of Edge browser displaying this to the bottom of the original post.
The “no certificate attached” is due to the TLS handshake failing and says nothing about the server having a certificate or not. The reason for the handshake failure is shown “ERR_SSL_VERSION_OR_CIPHER_MISMATCH”. This might for example be the case if you are trying to access a server (or at least the specific server port) configured for plain HTTP with HTTPS.