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

beginer
beginer
1544 Points
52 Posts

I'm trying to run (locally) asp.net core 3.1 api project on HTTPS on windows machine using Docker Linux container in VS-2019. But getting error:

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

Also, tried to change the launch settings:

But still, not able to run and getting same error.

Views: 52470
Total Answered: 3
Total Marked As Answer: 2
Posted On: 20-Apr-2020 01:29

Share:   fb twitter linkedin
Answers
Brian
Brian
2376 Points
13 Posts
         

Close your browsers so that they do not cache the certificate because that will cause other issues.

On the CMD run

dotnet dev-certs https --clean

And then run

dotnet dev-certs https -t

Now, you can then check the certificate with following command

dotnet dev-certs https --check

if this returns nothing which I assume means everything is fine.

Posted On: 21-Apr-2020 04:59
Smith
Smith
2890 Points
78 Posts
         

To disable Docker Https listening just remove 443 port from the following code in the file 'docker-compose.override.yml' or 'docker-compose.yml':

- ASPNETCORE_URLS=https://+:443;http://+:80

Replace it with:

- ASPNETCORE_URLS=http://+:80

.yml file screenshot=>

Posted On: 21-Apr-2020 23:06
Thanks
 - beginer  22-Apr-2020 00:34
great! thanks.
 - Rashmi  26-Oct-2023 02:30
Smile Man
Smile Man
30 Points
0 Posts
         

Solution:

1. Open certmgr.msc (Current User)

2. Delete all localhost certs at:

- Current User Trusted Root Certification Authorities/Certificates

- Personal/Certificates

Source : https://www.godevstack.com/2021/05/fixed-unable-to-configure-https.html

Posted On: 13-May-2021 01:25
 Log In to Chat