Part 1: Use the shared database
As yourself, in your ~/.bashrc add: export NSS_DEFAULT_DB_TYPE=sql If you are using ~/.cshrc add instead setenv "NSS_DEFAULT_DB_TYPE sql")
As yourself (not as root!!!) execute "certutil -N -d sql:/etc/pki/nssdb" If you supply a password, this password will eventually become your new firefox/thunderbird master password.
Part 2: Convince Firefox, Seamonkey, Xulrunner and Thunderbird to use system NSS
Firefox and Thunderbird still use private directories to store their NSS databases. It's possible, however, to convince them to open system NSS. All these steps should be performed as a user. In the future these applications would handle these steps by themselves automatically.
Do each of the following steps in each of the profile directories for which you wish to use system NSS in. Firefox, thunderbird, and seamonkey each have their own directories and can have multiple profiles (if you don't know what a profile is, you probably only have one per application). You can the base of the profile directories for firefox at ~/.mozilla/firefox and thunderbird at ~/.thunderbird. In that base directory there is a file called 'profiles.ini' which lists all the profiles that are known for that application. For each profile there's a line called "Path=" which points to the actual profile directory. Usually it's a subdirectory under the current directory and has a random "salted" name like "quxz7me5.default". do the following instructions while cd'd to that directory:
1) certutil -K -X -d sql:. Note: if you have a master password set, You'll have to provide it here.
This will create a new sql database from your old dbm database.
2) certutil --merge -d sql:~/.pki/nssdb --source-dir sql:.
If you have a password set on sql:~/.pki/nssdb, from step above, you'll have to provide it here. If that password is different from the master password for the profile, you'll also have to supply the profile password. If ~/.pki/nssdb has to password, but the profile database does, ~/.pki/nssdb will inherit that password (which you will then need on future instances of this step).
If you want to change that password use "certutil -N -d sql:~/.pki/nssdb". Supplying an empty password will remove any password.
3) edit pkcs11.txt
a) in the "NSS Internal PKCS #11 Module" stanza. change:
parameters="configdir='/home/{you}/.mozilla/firefox/quxy6me8.default' ..... Flags=internal,critical" to parameters="configdir='sql:/etc/pki/nssdb' .....
Flags=internal,critical,moduleDBOnly"
*
NOTE: the ... represents a very long string of parameters that should remain the same. Note the addition of the double quotes around the parameters. This tells NSS to use the parameters as given and now rebuild them based on application input.
b) save pkcs11.txt
4) Make sure you set NSS_DEFAULT_DB_TYPE to sql in your environment before you start Firefox or Thunderbird
Restoring your system to the old databases Simply unset the NSS_DEFAULT_DB_TYPE variable and all your applications will fall back to their former dbm style datbase.