如何在 Firefox 中永久添加自签名证书?

Den*_*nis 16 firefox browser certificates

当我通过 Firefox 访问我的家庭服务器 Nextcloud 的 Web 界面时,我收到以下消息:

在此输入图像描述

点击后Accept the Risk and Continue,Nextcloud的自签名证书会自动添加到Firefox浏览器中。添加的证书显示在 Firefox 证书管理器中Settings -> Privacy & Security -> Security -> Certificates -> View Certificates... -> Servers::

在此输入图像描述

一切正常,直到我关闭浏览器窗口。关闭浏览器窗口后,证书消失。

事实上,Lifetime第二张图中的证书显示为Temporary。我还包括在关闭时自动清除浏览器历史记录。

如何使该证书永久保留在浏览器中(即使关闭浏览器窗口时)?

PS 我使用 Firefox 87 + Arch Linux。

更新:

我尝试将必要的证书添加到Security Exception(建议的方式A.B):

  • Preferences -> Privacy & Security -> View Certificates
  • 选择Servers Tab并单击Add Exception
  • 填写 https URL(例如: https: //self-signed.badssl.com/)并单击Get Certificate

之后,我看到以下窗口,其中选项被Permanently store this exception阻止:

在此输入图像描述

当我按 时Confirm Security Exception,自签名证书将添加到例外中,仅再次使用该Temporary属性(如第二张图片所示)。

当我对 URL 执行此操作时https://192.168.1.5:40443/https://self-signed.badssl.com/结果是相同的。

A.B*_*A.B 12

易于测试的 URL: https: //self-signed.badssl.com/

有两种方法:

  • 切换 Firefox 以设置默认添加为终身永久的服务器证书

    • about:config切换security.certerrors.permanentOverridetrue

    • 像往常一样添加异常(如OP所述),它将把Lifetime属性设置为Permanent

    对于相反的情况,请参考Mozilla Ticket 1414753,将它们暂时保留,这是 OP 希望避免的:

    security.certerrors.permanentOverride现在可以设置为 false。

  • 或者像这样手动添加证书

    • 转到首选项 -> 隐私和安全 -> 查看证书
    • 选择服务器选项卡并单击添加例外
    • 填写 https URL(例如: https: //self-signed.badssl.com/ )并单击“获取证书”
    • 确保已Permanently store this exception检查
    • 单击确认安全异常

    Permanently store this exception是通过之前的切换自动设置或取消设置的内容。这里可以选择检查或者不检查。