Unknow error importing user certificate [Solved]

Using Firefox from Debian 12 (old stable) repositories, now 140.6.0esr, I’ve encountered a strange error with personal certificates. I had recently (talking about months) updated the certificate and hadn’t used it for a while. However, when I checked it the other day, I found it had disappeared. Fortunately, I remembered the password to import it again: The intention was precisely to make a backup with a more accessible key (to avoid accidentally forgetting it). So it was lucky that I was able to locate the old key. Otherwise, I would have needed to go through the entire bureaucratic process to obtain it again.

However, every time I’ve tried to import it, I’ve gotten an “unknown error” message. The certificate was installed correctly, but it disappeared again when Firefox was closed.

Apparently, it’s a corruption of the cert9.db file. Simply deleting this file will regenerate it and restore the consistency of the certificate database. Side effect: any manually added certification authority is also removed.

Best regards

Notes: The cert9.db file is in the profile’s root directory. The path in Debian is usually $HOME/.mozilla/firefox/ plus profile name (a random directory name, unless profile.ini has been customized).