According to LinuxCertManagement:
For example, to trust a root CA certificate for issuing SSL server certificates, use
certutil -d sql:$HOME/.pki/nssdb -A -t "C,," -n <nickname> -i <filename>
Note: to trust a self-signed server certificate, we should use
certutil -d sql:$HOME/.pki/nssdb -A -t "P,," -n <nickname> -i <filename>
Unfortunately that doesn't work because of NSS bug 531160. To work around the NSS bug, you have to trust it as a CA using the "C,," trust flags.
For Firefox, change the -d argument to Firefox profile path, without sql:.
certutilutility to do this (it's included in Debian/Ubuntu'slibnss3-toolspackage and should be in a similar package in other distros). Unfortunately, I can't seem to get it to work on either Chrome or Firefox's NSS databases on my machine. – Patches May 17 '11 at 0:28