VS 2022 not finding dev SSL cert

Marbry Hardin 6 Reputation points
2022-09-26T15:37:11.62+00:00

VS 2022, ASP.NET Core web application keeps throwing the error that there is no valid development certificate. When in fact there is one.

I've been through multiple rounds of deleting any certs manually, running clean and trust commands, but as soon as it gets back to the UseHttps() line in code it always throws the error that it can't find the dev cert.

Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found or is out of date.

The proper localhost certificate is in both the Personal and Root folders under current user, and the date range is valid.

VS just isn't finding it for some reason. Any ideas?

I'd add that I've tried to directly retrieve the cert in code and set it as the parameter to the UseHttps() command, but for some reason when it returns the contents of the X509 store, the localhost cert is not in the results.

I'm not sure if this is a "special" behavior or not. I have just the readonly and existingonly filters on the call to open the store. But there is most certainly a valid cert in that store when I look at it in the mmc certificate console.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,668 questions
Windows Server Security
Windows Server Security
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
1,863 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.