1
votes

I know the hsts (http to https) will work from the very first time If my site is registered in the preload list. On the other hand I am also declaring preload in hsts header in my web server.

What if I access my site for the very first time with http which one is gonna happen first? I mean will the site access the preload list first or web server first?

enter image description here

1

1 Answers

0
votes

You need to submit your site to the browsers preload list. It will then yet you are issuing the preload header (to prevent bad actors submitting sites to preload list when they don’t want it), and include it in the inbuilt list in future release.

Some browsers also regularly scan or crawl websites looking for sites with preload headers to include. Though I believe this is done less, and it’s better to explicitly submit your site.

After the site is included in the browsers preload list and request for http:// version will automatically be converted to https://. This happens before you send the request, so before you get the HSTS header response.

That’s the point of preloading - to protect you before you even make a single request.

Personally I’m not a fan of preload. Hard coding a list of sites something into a browser has obvious scaling issues but, more importantly, when you do that you’re taking a risk with something you can’t change back without waiting months or possibly years for browser vendors to pickup the reverted setting to remove the code. I personally believe preload is overkill for most sites.