Skip to content

Instantly share code, notes, and snippets.

@thetwopct
Last active July 20, 2021 19:06
Show Gist options
  • Save thetwopct/206edcf1c3110fd81a09d1af154e6cbf to your computer and use it in GitHub Desktop.
Save thetwopct/206edcf1c3110fd81a09d1af154e6cbf to your computer and use it in GitHub Desktop.
Fix Safari "Can't establish a secure connection to the server" with self-signed certificates (Lando, Vagrant, Docker etc)
# Stop the HTTP storage manager (since it has an in-memory cache of the HSTS hosts).
killall nsurlstoraged
# Delete the HSTS cache file.
rm -f ~/Library/Cookies/HSTS.plist
# This may not work if Terminal is not configured for "Full Disk Access", so instead:
# Open Finder, Shift+Apple+G, paste in ~/Library/Cookies/ and manually delete HSTS.plist
# Start up nsurlstoraged again
launchctl start /System/Library/LaunchAgents/com.apple.nsurlstoraged.plist
## Otherwise
# Open Keychain Access
# Go to All Items
# Filter by some of the sites URLs
# Delete the related secure certificates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment