From the course: Building and Securing RESTful APIs in ASP.NET Core

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Require HTTPS

Require HTTPS - ASP.NET Core Tutorial

From the course: Building and Securing RESTful APIs in ASP.NET Core

Start my 1-month free trial

Require HTTPS

- [Instructor] ASP.NETCORE 2.0 and later come with https turned by default. If you look at launchsettings.json you'll see hat IIS Express is configured to listen for http traffic on, in my case, six, three, seven, nine, eight, and SSL or https traffic on four, four, three, five, oh. These ports are randomized and they'll be different in your case. Over in startup.cs they use https redirection middle ware is included in the configure method by default. This means that any clients that try to connect to the http port, get a redirect response pointing them at the https port. You can see this behavior in Postman if you send a request to the http port. The response will get, actually is just a three, oh, seven with a location to the https port. If you don't see this happening in Postman it might be because you have the setting turned on automatically follow redirects. I'd recommend turning this setting off in Postman 'cause it just makes things confusing. This redirection is a convenient…

Contents