Docker image: Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found

As soon as you’ve setup the certificate in nginx, I see no sense enabling it in the asp.net core container as your docker network is going to be visible to public via nginx.

To disable Kestrel Https listening just remove 443 port from the following code:

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

Replace it with:

- ASPNETCORE_URLS=http://+:80

With .NET 8.0 container some breaking changes were introduced:

We also added the new ASPNETCORE_HTTP_PORTS environment variable as a simpler alternative to ASPNETCORE_URLS. The new variable expects a semicolon delimited list of ports numbers, while the older variable expects a more complicated syntax.

Apps built using the older WebHost.CreateDefaultBuilder() API won’t respect the new ASPNETCORE_HTTP_PORTS environment variable. And now that ASPNETCORE_URLS is no longer set automatically, they’ll switch to use a default URL of http://localhost:5000, rather than http://*:80, as formerly.

Detailed information:
https://learn.microsoft.com/en-us/dotnet/core/compatibility/containers/8.0/aspnet-port

Leave a Comment

tech