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
122 Points
41 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: 381
Total Answered: 2
Total Marked As Answer: 1
Posted On: 20-Apr-2020 01:29

Share:   fb twitter linkedin
Answers
Brian
Brian
Participant
598 Points
79 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
Participant
504 Points
127 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
 Log In to Chat