News for hackers. Stuff that matters.
Re:Consider disabling HTTPS auto redirects by toast0 on Monday June 27, 2022 @11:17AM (#31895755)
One way to manage this is to use HSTS to send modern browsers to https and leave older browsers to whatever they want.

a) put your content on www.example.com because it's important

b) redirect http://example.com to https://example.com because this is required for HSTS preloading. And from there to https://www.example.com because it's important that your contentful urls be at a domain that isn't going to redirect.

c) serve hsts preload headers at least for https://example.com; serve hsts headers for at least https://example.com/favicon.ico

d) set your favicon on all pages to https://example.com/favicon.ico

e) submit to the hsts preloading site

f) remove redirects from http to https on www

Modern browsers with preload built after your site is added would always use https. Modern browsers without the preload will load whatever the first page they hit as http, but pickup the preload from the favicon and future page loads will be https. Resources from the first load will likely be http, depending on favicon loading timing. There's no additional MITM risk for modern browsers, because a MITM could avoid your redirect if an http load is attempted just as well as they could mess with your HTML.

Older browsers can still go to the http version, although inbound links are likely to be https, because people like to cut and paste from the URL bar, and most people are going to have a modern browser with your site preloaded. Users of older browsers would need to edit the url in the URL bar, a skill they'd likely rapidly develop.

There are no comments on this comment yet.