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
290 Points
80 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: 38848
Total Answered: 3
Total Marked As Answer: 1
Posted On: 20-Apr-2020 01:29

Share:   fb twitter linkedin
Answers
Brian
Brian
Moderator
694 Points
92 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
Moderator
738 Points
154 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
Smile Man
Smile Man
2 Points
1 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