Adding the HTTP strict transport security header

The strict transport security header is an excellent feature that strengthens the implementation of TLS (Transport Level Security) by getting the User Agent and forcing it to use HTTPS. We can add the strict transport security header by adding the following middleware to our Configure method of the Startup class:

app.UseHsts(options => options.MaxAge(days:365).IncludeSubdomains());

This middleware enforces your site so that it can only be accessed over HTTPS for a year. This applies to subdomains as well.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.51.157