Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1793

How to set up HTTPS with certificate file on .NET 8.0 ASP.NET Razor Pages?

$
0
0

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?


Viewing all articles
Browse latest Browse all 1793

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>