Using HTTPS In ASP.NET Core 2.0


How to ensure the use of HTTPS in ASP.NET Core.


Create an empty project and update Startup to add services and middleware for MVC, including the filter for HTTPS,

You could setup a redirect from HTTP to HTTPS on the web-server (e.g. IIS) or use middleware in ASP.NET Core,


For testing in IIS Express, you can enable SSL from project Properties > Debug tab by checking the Enable SSL flag.

Source Code