ASP.NET 5 MVC application is published as self contained executable in Visual Studio 2019.
appsettings.json has standard settings:
{
"AllowedHosts": "*", "Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
} }, "runtimeOptions": {
"configProperties": {
"System.GC.HeapHardLimitPercent": 30
} } }
In same development workstation it listens in two ports:
info: Microsoft.Hosting.Lifetime[0]
Now listening on: http://localhost:5000 info: Microsoft.Hosting.Lifetime[0]
Now listening on: https://localhost:5001 info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down. info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production info: Microsoft.Hosting.Lifetime[0]
Content root path: C:\eeva\store5
If application is copied to production server, running store.exe listens only in http port.
Line
Now listening on: https://localhost:5001 info: Microsoft.Hosting.Lifetime[0]
Member
52 Points
613 Posts
Use kestrel with https in production server
Apr 02, 2021 08:43 AM|kobruleht|LINK
If application is copied to production server, running store.exe listens only in http port.
Line
Now listening on: https://localhost:5001 info: Microsoft.Hosting.Lifetime[0]
does not appear in output.
How to use https in production server ?
All-Star
48720 Points
18184 Posts
Re: Use kestrel with https in production server
Apr 02, 2021 11:23 AM|PatriceSc|LINK
Hi,
According to https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel/endpoints?view=aspnetcore-5.0 it uses https only when a "development certificate" (ie self signed?) is found but a production certificate needs to be configured explicitly.
All-Star
53711 Points
24035 Posts
Re: Use kestrel with https in production server
Apr 02, 2021 11:59 AM|mgebhard|LINK
Are you using dotnet to run the application? Well, you need a certificate for localhost. You also must configure Kestrel.
https://stackoverflow.com/questions/46621788/how-to-use-https-ssl-with-kestrel-in-asp-net-core-2-x
The official documentation covers the detials.
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel?view=aspnetcore-5.0