How do I force HTTPS in Safari for macOS?

Solution 1:

The closest you can get in built-in Safari is

Safari 15

Upgrade known hosts to HTTPS’ in Safari 15 under Debug → WebKit Internal Features.

It's enabled by default in Safari 15: https://trac.webkit.org/browser/webkit/trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml?rev=275449#L729

On launching Safari 15 for the first time, a What’s New page appears with the following:

HTTPS upgrade automatically switches sites from HTTP to more secure HTTPS when available

Safari 14

Automatic HTTPS upgrade’ in Safari 14 under Develop → Experimental Features.

It's disabled by default in Safari 14: https://trac.webkit.org/browser/webkit/trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml?rev=273683#L388

It's described as

Automatic HTTPS upgrade for known supported sites


When this feature was being tested, it only had 3 sites in the list.

https://opensource.apple.com/source/WebKit2/WebKit2-7611.2.7.1.4/Shared/HTTPSUpgrade/HTTPSUpgradeList.txt.auto.html

The list was changed from a \n-delimited text file to HTTPSUpgradeList.db, tested with 10M domains

They can all search a list of up to 10M domains in <1ms.

https://bugs.webkit.org/show_bug.cgi?id=192736#c17

but I can't find this database anywhere so far.