As every developer wants to replicate local web development set up as per production environment as much as possible.
- Download and Install .Net Core 2.1 from this site.
- Create new .Net core 2.1 web app
- Use following commands to install certificates locally
dotnet dev-certs https --help
dotnet dev-certs https --trust
- Read pop up and click yes to install certificate from localhost.
- Run your app, You will notice that your app is running on https locally.
- By default HTTPS redirection is included in ASP.NET Core, and in Production it’ll use HTTP Strict Transport Security (HSTS) as well, avoiding any initial insecure calls.
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
- public void Configure(IApplicationBuilder app, IHostingEnvironment env)