当我使用 Node 的 http2 库(仅支持 HTTPS,不支持 HTTP)进行开发时,当我在 Chrome 中打开 localhost 时,我会看到一个警告屏幕:
Your connection is not private
Attackers might be trying to steal your information from localhost (for example, passwords, messages or credit cards). Learn more NET::ERR_CERT_AUTHORITY_INVALID
您必须单击“高级”,然后单击“继续到本地主机(不安全)”。在开发过程中必须这样做很烦人。
我根据 Node 的 http2 module 的说明生成了供本地主机使用的证书和 key .有没有什么办法可以让 Chrome 真正接受本地主机的方式来生成它们?还是有另一种简单的方法来消除此警告?
(我知道使用 --ignore-certificate-errors
启动 Chrome 的选项,但我不希望对所有网站都这样做。)
最佳答案
尝试以下操作:
在 Chrome 中,在地址栏中输入 chrome://flags/#allow-insecure-localhost。
启用“允许从本地主机加载的资源使用无效证书”选项。
重新启动 Chrome,它应该允许该网站。
关于google-chrome - 本地开发HTTP2网站如何避免出现 "Your connection is not private"画面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50534200/