5

When I go to the web interface of my home server Nextcloud via Firefox, I get the following message:

enter image description here

After I click Accept the Risk and Continue, and then the self-signed certificate of Nextcloud is automatically added to the Firefox browser. The added certificate is displayed in the Firefox Certificate Manager: Settings -> Privacy & Security -> Security -> Certificates -> View Certificates... -> Servers:

enter image description here

And everything works well until I closed the browser window. After closing the browser window, the certificate disappears.

The fact is that the Lifetime of the certificate in the second figure is displayed as Temporary. I also included automated clearing browser history when closing.

How to make so that this certificate is permanently kept in the browser (even when closing the browser window)?

P.S. I use Firefox 87 + Arch Linux.

Update:

I try to add the necessary certificate to Security Exception (the way proposed A.B):

  • go to Preferences -> Privacy & Security -> View Certificates
  • choose Servers Tab and click Add Exception
  • fill in the https URL (eg: https://self-signed.badssl.com/) and click Get Certificate

After that, I get the following window, where option the Permanently store this exception is blocked:

enter image description here

When I press the Confirm Security Exception, then the self-signed certificate is added to exception, only again with the Temporary property (as on the second image).

When I do it for URL https://192.168.1.5:40443/ or https://self-signed.badssl.com/ the result is the same.

5

Easy URL to test: https://self-signed.badssl.com/

There are two ways:

  • toggle Firefox to set server certificates added as Lifetime Permanent by default

    • in about:config toggle security.certerrors.permanentOverride to true

    • add the exception as usual (as described by OP), it will have the Lifetime property set as Permanent

    reference from mozilla ticket 1414753 for the opposite case, have them temporary, which OP wants to avoid:

    You can set security.certerrors.permanentOverride to false now.

  • or add the certificate manually like this

    • go to Preferences -> Privacy & Security -> View Certificates
    • choose Servers Tab and click Add Exception
    • fill in the https URL (eg: https://self-signed.badssl.com/ ) and click Get Certificate
    • ensure that Permanently store this exception is checked
    • click Confirm Security Exception

    The Permanently store this exception is what gets automatically set or unset with the previous toggle. Here one can choose to check it or not.

2
  • Thank you for your answer. In the first method, switching the setting security.certerrors.permanentOverride to true did not get the desired result (after closing the browser, the certificate disappears). In the second method, the Permanently store this exception option is disabled (I wrote more about this in the update of my question).
    – Denis
    Apr 9 '21 at 11:13
  • I'm afraid someone with the very same version of Firefox and OS should answer. It appears the feature is disabled on purpose on your system. Or there's an other option involved.
    – A.B
    Apr 9 '21 at 11:47
2

The "permanently store this exception" option will be gray in private browsing mode.

Private browsing mode might be set to enabled automatically on startup in prefs.js or user.js

It would look like this:

user_pref("browser.privatebrowsing.autostart",true);

Disabling this and starting in regular mode will allow you to check the box and follow the steps outlined by user A.B

3
  • Keep in mind: 1. The browser must be stopped before doing any change, and 2. prefs.js is sorted.
    – ATorras
    Nov 16 '21 at 8:29
  • @ATorras It's sorted? Like... alphabetically? Why? That's weird.
    – ADJenks
    Nov 16 '21 at 18:55
  • Yep! I think FFox will be smart enough to take care of unsorted data, but I haven't tested it.
    – ATorras
    Nov 16 '21 at 21:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.