google-chrome - Localhost SSL 连接到 api ERR_SSL_PROTOCOL_ERROR

标签 google-chrome ssl https

我正在尝试在我的开发环境中通过 Chrome 连接到 API。

我已将本地主机配置为在 SSL 下运行以进行测试,

当我使用 https:// 连接到 API 时出现此错误

request.js:132 OPTIONS https://api.thenounproject.com:80/icons/test
net::ERR_SSL_PROTOCOL_ERROR

为了让本地开发在 Chrome 中运行在 https 上,我必须启用:

chrome://flags/#allow-insecure-localhost. 

开发环境中是否存在这些讨厌的安全问题?

最佳答案

老问题,可能你已经有了答案,但我还是会发布它,因为如果你寻找 ERR_SSL_PROTOCOL_ERRORlocalhost,它是谷歌上的热门话题(有 732 次观看)。

我在使用 NGINX 时遇到了这个错误,并在 google chrome 中得到了 ERR_SSL_PROTOCOL_ERROR。谷歌搜索该错误消息并没有给我一个快速的答案。然而,Firefox 抛出 SSL_ERROR_RX_RECORD_TOO_LONG。谷歌搜索该错误消息使我找到了 this answer服务器故障及其接受的答案对我有用。

我所要做的就是将 ssl 添加到服务器 block 中的监听行:

listen 443 ssl;

NGINX documentation也提到了这一点。

To configure an HTTPS server, the ssl parameter must be enabled on listening sockets in the server block, and the locations of the server certificate and private key files should be specified:

关于google-chrome - Localhost SSL 连接到 api ERR_SSL_PROTOCOL_ERROR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48571876/

相关文章:

c# - SMTP - SSL 证书问题 - C# - 为什么此代码有效?

javascript - Chrome DevTools 搜索网站中的所有 javascript 文件

javascript - 让 Google Chrome 扩展程序仅在一个选项卡上运行

php - 使用 php 脚本 smtp.gmail 发送电子邮件时出错 Pear Centos

amazon-web-services - 我的带有子文件夹的域可以连接到 EC2 吗?

ios - 在 iOS App 中从 http 切换到 https 会在发布时出现导出合规性问题

java.security.cert.CertificateException : No subject alternative DNS name matching

javascript - 脚本在 chrome 中有效,但在 firefox 中无效

css - 在chrome中使用REM,无法重现错误

caching - magento https + IE8 提示问题