How to Fix Unable to Configure HTTPS Endpoint ASP.NET Core

In this article tutorial, we will discuss about how to fix “Unable to configure HTTPS endpoint. No server certificate was specified”. We have also written few tutorials about .net core error that might you experience. Feel free to read our previous post about Asp.net core error that you might encounter when you deployed your .net core application.

With .NET, it’s always easy to generate self-signed certificates for your web applications. You can issue them in Visual Studio or dotnet SDK command-line. If you create a new web application in Visual Studio, at first, you’ll see the following message:

Or you can quickly issue your self-signed certificate for localhost with the command below:

dotnet dev-certs https# the possible result after succesful execution would b:
# The HTTPS developer certificate was generated successfully.

But sometimes, like my case, it won’t help, and you’ll see this annoying exception:

Remedy #1

If you Google the issue, you might find things about running clean-up command then re-issuing the certificate like below:

dotnet dev-certs https --clean
# HTTPS development certificates successfully removed from the machine.
dotnet dev-certs https
# The HTTPS developer certificate was generated successfully.

This should work, but sometimes, like in my case, it won’t do any good; after every Visual Studio Launch, the message about the issue and trust self-sign certificate keeps popping up!

Remedy #2 (ultimate)

When things don’t work as expected, nothing is better than doing all things manually.

To track the issue, I checked personal certificates in the Windows Certificate Store to see if the certificate is installed correctly. I encounter a long list of issued certificates for localhost!

Not sure if it’s a bug or an environmental problem on my machine, but Visual Studio and .NET SDK issued a new certificate every time.

I removed the certificates and re-issued it with the command line:

dotnet dev-certs https

And the problem solved:

How to access Windows Certificates Store and How to remove these?

  1. Open Run and open mmc.exe
  2. Inside MMC from File menu click on Add/Remove Snap-in
  3. In the add/remove snap-in window, find certificates in available snap-ins and add it to the selected
  4. Pick Use account
  5. In the console root -> Certificates Current User -> Personal click on Certificates
  6. You will see the list of issued and installed certificates for the current user. DON’T remove or change any certificates you don’t know, only remove certificates related to self-sign localhost ASP.NET Core.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *