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

错误信息

net::ERR_CERT_AUTHORITY_INVALID

警告页上显示的错误代码是“NET::ERR_CERT_AUTHORITY_INVALID”;自动化工具(Playwright、Puppeteer、Selenium 日志)报告的是“net::ERR_CERT_AUTHORITY_INVALID”,我们用无头浏览器复现时输出的也是这个。Edge 和其他基于 Chromium 的浏览器使用相同的代码。

Chrome, Edge and other Chromium browsers — certificate error interstitial "Your connection is not private"

含义

Chrome 无法从该网站的证书构建出一条通往其信任的根证书的链,因此用“Your connection is not private”警告页拦截了页面。证书可能是自签名的、由私有 CA 签发的、发送时缺少中间证书,或者被拦截连接的某个程序替换了。在 Windows 和 macOS 上,Chrome 使用操作系统的证书存储(对公共 CA 则使用自己的 Chrome Root Store);在 Linux 上则使用 NSS 数据库。

原因

修复方法

  1. 1.

    网站所有者:检查服务器发送的证书链

    如果服务器只发送了一张证书,而它的颁发者是中间 CA,说明服务器配置不完整。

    bash
    # Site owners: which certificates does the server send? (1 = intermediate missing)
    openssl s_client -connect www.example.com:443 -servername www.example.com -showcerts </dev/null 2>/dev/null \
      | grep -E '^ *[0-9]+ s:|^ *i:'
  2. 2.

    网站所有者:发送完整证书链

    为 Web 服务器配置完整证书链文件,让所有客户端(不只是 Chrome)都能验证它。

    text
    # nginx: serve leaf + intermediates
    ssl_certificate     /etc/letsencrypt/live/www.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/www.example.com/privkey.pem;
  3. 3.

    内部站点:在受管设备上安装私有根证书

    通过设备管理或操作系统证书存储分发公司根证书;在 Linux 上,将其添加到 Chrome 读取的 NSS 数据库中。

    bash
    # Internal sites: install the company root on the client (Chrome uses the OS store on
    # Windows and macOS; on Linux, the NSS database in ~/.pki/nssdb)
    certutil -d sql:$HOME/.pki/nssdb -A -t "C,," -n corp-root -i corp-root-ca.pem
  4. 4.

    用户:先查看证书由谁签发,再做其他操作

    证书查看器会显示颁发者。点击跳过警告(“Proceed to … (unsafe)”)只应在你自己的设备上、且处于你信任的网络时使用;在陌生网络中,这样做等于把你的会话交给出示该证书的人。

    text
    Click "Not secure" in the address bar → "Certificate details" and read the issuer.
    A company or security-vendor name on a public site = TLS inspection on your network.
    An unknown issuer on public Wi-Fi = do not proceed.

相关错误

浏览完整的签名错误库