I am trying to import a personal digital certificate to Firefox (under Your certificates) and I am getting this error:

The PKCS #12 operation failed for unknown reasons.

I am using Firefox 72.0.2 on Ubuntu 18.04.3 LTS. I already successfully imported this certificate into Firefox on Windows 10 and exported a backup (.p12).

What I have already tried:

  • I made sure the password I am using is correct by checking that the output of openssl pkcs12 -in myCertificate.pfx -noout was MAC verified OK.

  • I tried importing the certificate both as .p12 and .pfx files and I also tried setting a blank password if that would be the cause of the problem.

  • I found a very old bug related to this, but I do not have the torbutton extension installed.

  • I also tried importing the certificate using the terminal like this

    pk12util -i cert.pfx -d ~/.mozilla/firefox/randomchars.default

as mentioned in the linked bug report and in another AskUbuntu question. I got pk12util: PKCS12 IMPORT SUCCESSFUL as a result, but I cannot see the certificate under "Your certificates" and neither in the output of certutil -L -d sql:~/.mozilla/firefox/randomchars.default

Does anyone have another suggestion of where I could be going wrong?

4 Answers 4


I managed to import the certificate by combining the answer linked above with the one at SuperUser.

The command I used was:

pk12util -i cert.pfx -d sql:/home/username/.mozilla/firefox/randomchars.default/

in which I substituted the username and randomchars accordingly.

It seems that the problem was that I hadn't specified that the certdir is a SQL database.


I already did have a valid pfx file and could not import due to the error mentioned above. After quitting Firefox and staring with an empty session it suddenly worked.

I am using macOS and Firefox 78.0.2 (64-bit).


I wasn't able to install FILENAME.pfx under Ubuntu on Chrome or Firefox altough I had no problems installing the very same file on IE under Windows. What I did to solve the issue :

openssl pkcs12 -in FILENAME.pfx -clcerts -nokeys -out FILENAMEcert.pem
openssl pkcs12 -in FILENAME.pfx -nocerts -out FILENAMEkey.pem
openssl pkcs12 -export -in FILENAMEcert.pem -inkey FILENAMEkey.pem -out FILENAME.p12

Then install FILENAME.p12 on Chrome or Firefox under Ubuntu should work like a charm :)


In Ubuntu (linux) delete or (rename) files key4.db (key3.db) and cert9.db (key3.db) in .mozilla/firefox/username. It works for me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .