跳到主要内容
ecdsa.com
Chrome, Edge and other Chromium browsers浏览器

错误信息

net::ERR_SSL_PROTOCOL_ERROR

错误页面上显示为“ERR_SSL_PROTOCOL_ERROR”,在自动化工具和开发者工具中显示为“net::ERR_SSL_PROTOCOL_ERROR”。

Chrome, Edge and other Chromium browsers — "This site can't provide a secure connection"

含义

Chrome 无法完成 TLS 握手,因为服务器的回复违反了协议:最常见的情况是对方根本不是 TLS(该端口上运行的是纯 HTTP 服务器),或者服务器发送了格式错误或意料之外的握手数据。页面会显示“This site can't provide a secure connection — <host> sent an invalid response”。这与证书无关。

原因

修复方法

  1. 1.

    检查端口使用的协议

    如果响应的是纯 HTTP,就改用 TLS 端口,或在该监听器上启用 TLS。

    bash
    curl -si http://www.example.com:8080/ | head -1              # plain HTTP answers?
    openssl s_client -connect www.example.com:443 -servername www.example.com -brief </dev/null
  2. 2.

    开发环境:清除 HSTS 或使用本地 HTTPS

    在 chrome://net-internals/#hsts 中删除该主机的 HSTS 条目(预加载的域名无法删除),或者为开发服务器配置一张本地受信任的证书。

    text
    Local development on a domain with HSTS (e.g. *.dev, or a site you once visited over HTTPS):
    open chrome://net-internals/#hsts, "Delete domain security policies" for the host,
    or serve the dev site over HTTPS with a locally trusted certificate (mkcert).
  3. 3.

    网站所有者:在提供 https:// 的端口上启用 TLS

    为监听器配置 TLS 和证书,并从外部测试握手。

    text
    Site owners: make sure the port that browsers reach with https:// has TLS enabled
    (nginx: "listen 443 ssl;" plus ssl_certificate / ssl_certificate_key).

相关错误

浏览完整的签名错误库