.NET Core 6 self-hosting web app using expired SSL cert

Viewed 178

I have a .NET 6 web app that was running fine in self-hosting mode with VS 2022 until June 21, 2022. Now when I run the same app, which opens on https://localhost:7097, the browser (Edge) says that the cert authority is invalid and says the site is not secure.

The screenshot below shows the cert details displayed by the browser. Note the expiry date of June 21, 2022.

enter image description here

When I search for this cert on my machine I cannot find it anywhere. I have also tried:

dotnet dev-certs https --clean
dotnet dev-certs https --trust

and this does not solve the problem. The dev cert (which is currently valid until 2023-07-21) is not being used for some reason. A complete uninstall/reinstall of VS 2022 did not fix the problem.

What is going on? Is there somewhere in the project of VS config where the default SSL cert is defined?

1 Answers
Related