I have set up a new ASP.NET Razor Pages from the template on a Debian-based system. I have a certificate at /fake/path/fullchain.pem and a private key /fake/path/myprivkey.pem (path for illustration purposes only). I would like to run my Razor Pages app and access it over HTTPS, but the app only listens for http requests.
HTTPS redirection is enabled in the template like so:
app.UseHttpsRedirection();I added the following lines to appsettings.json, which causes the app to try to redirect to https, but the request (connection refused). Based on the log messages at start, the app is only listening on the http port (5000).
"https_port": 5001, "linux": { "Kestrel": { "Endpoints": {"Http": {"Url": "http://localhost:5000" }, "Https": { "Url": "https://localhost:5001", "Certificate": {"Path": "/fake/path/fullchain.pem","KeyPath": "/fake/path/myprivkey.pem" } } } } }How do I configure the app to listen on HTTPS?





