Safari 不断在本地主机上强制使用 HTTPS [英] Safari keeps forcing HTTPS on localhost
问题描述
当我在 Safari 中加载 http://localhost:3000
时,Safari 会自动重定向到 https://localhost:3000
.如何禁用此功能?
When I load http://localhost:3000
in Safari, Safari automatically redirects to https://localhost:3000
. How can I disable this functionality?
我进入 ~/Library/Cookies/HSTS.plist
并删除 localhost
条目,然后重新启动 Safari 但它只是将其重新添加到该 plist 文件中重定向到 https.
I went into ~/Library/Cookies/HSTS.plist
and removed the localhost
entry, then restarted Safari but it just re-added it to that plist file and redirected to https.
任何想法如何解决这个问题,以便在 localhost
上我必须明确说 http 或 https?
Any ideas how to fix this so that on localhost
I have to explicitly say http or https?
推荐答案
我能够根据 的答案解决这个问题提出不同的要求.
简而言之,关闭 Safari,然后运行以下命令即可.
In short, closing Safari, then running the commands below, worked.
sudo killall nsurlstoraged
rm -f ~/Library/Cookies/HSTS.plist
launchctl start /System/Library/LaunchAgents/com.apple.nsurlstoraged.plist
运行后重新启动 Safari 并尝试转到 http://localhost:3000
解决了问题,但没有重定向到 https
.
Restarting Safari after running that and trying to go to http://localhost:3000
solved the problem and did not redirect to to https
.
希望这有助于有人解决这个问题.
Hopefully this helps someone fix this problem.
这篇关于Safari 不断在本地主机上强制使用 HTTPS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!