Last post Jul 12, 2017 03:21 AM by priyalwalpita
Jul 11, 2017 01:25 PM|TheCoder007|LINK
I need to implement the HSTS (HTTP Strict Transport Security) in my ASP.Net Core MVC application. How can I achieve this simply in my code ?
Jul 12, 2017 03:21 AM|priyalwalpita|LINK
You need to Implement the HSTS usage in your ASP.Net core middleware as follows. You can use Nuget Package
NwebSec for this.
After implementing this you can go to the https://hstspreload.org/ and request your browser to preload your SSL certificate's hash. If not your first request will not use HSTS ( Because the first request is unknown
what is being implemented in the server side)
Then you can use the preload notation in your middleware as follows.