错误信息
SEC_ERROR_UNKNOWN_ISSUER
在警告页的“Advanced”下显示为“Error code: SEC_ERROR_UNKNOWN_ISSUER”;自动化工具只报告错误码本身。自签名的网站证书在警告页上有专门的错误码(MOZILLA_PKIX_ERROR_SELF_SIGNED_CERT);在我们的测试中,Playwright 构建的 Firefox 只把它们报告为 SSL_ERROR_UNKNOWN。
Firefox (NSS) — "Warning: Potential Security Risk Ahead", certificate issuer not trusted
含义
Firefox 无法从网站证书构建出一条通往其信任库中某个根证书的链,因此显示“Warning: Potential Security Risk Ahead”,错误码为 SEC_ERROR_UNKNOWN_ISSUER。除非启用了企业根证书,否则 Firefox 使用的是自己的 NSS 根证书库(Mozilla 的列表),而不是操作系统的。常见原因是私有 CA、检查流量的代理,或者服务器没有发送中间证书。
原因
私有 CA 或执行 TLS 检查的代理
常见除非开启了 security.enterprise_roots.enabled(或 ImportEnterpriseRoots 策略),否则 Firefox 不会使用安装在 Windows 或 macOS 中的公司根证书。
服务器没有发送中间证书
常见Firefox 会预加载公共 CA 的中间证书,这掩盖了许多此类配置错误;私有中间证书和新的中间证书仍会失败。
根证书装进了操作系统,却没有装进 Firefox
偶见尤其是在 Linux 上,系统证书包中的根证书并不属于 Firefox 的证书库。
修复方法
- 1.
受管设备:通过策略信任公司根证书
策略文件 policies.json(或等效的 GPO/MDM 设置)可以从操作系统的证书库导入根证书(ImportEnterpriseRoots),并安装额外的 CA 文件。
json { "policies": { "Certificates": { "ImportEnterpriseRoots": true, "Install": ["/etc/ssl/private-ca/corp-root-ca.pem"] } } } - 2.
网站所有者:发送完整证书链
配置包含完整证书链的文件;用不缓存中间证书的客户端(例如 openssl)测试。
bash # Site owners: Firefox also caches intermediates, so test with a fresh client openssl s_client -connect www.example.com:443 -servername www.example.com -showcerts </dev/null 2>/dev/null \ | grep -E '^ *[0-9]+ s:|^ *i:' - 3.
用户:接受风险之前先检查颁发者
“Accept the Risk and Continue”会为该证书添加一个永久例外;只在你控制的网络中、针对你自己的设备这样做。
text Click "Advanced" → "View Certificate" and read the issuer before deciding anything: company or security-vendor name → trust that root via policy or Settings → Certificates; unknown issuer on a public network → do not accept the risk.