Skip to content

Instantly share code, notes, and snippets.

@ThomasLeister
Created February 23, 2017 10:19
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThomasLeister/f55fa9c2e85b506ce00ed91f059f0138 to your computer and use it in GitHub Desktop.
Save ThomasLeister/f55fa9c2e85b506ce00ed91f059f0138 to your computer and use it in GitHub Desktop.
Firefox, Thunderbird, Chromium, Chrome Root CA certificate installer
#!/bin/bash
### Script installs root.cert.pem to certificate trust store of applications using NSS
### (e.g. Firefox, Thunderbird, Chromium)
### Mozilla uses cert8, Chromium and Chrome use cert9
###
### Requirement: apt install libnss3-tools
###
###
### CA file to install
###
certfile="root.cert.pem"
certname="ADITO Software Root CA"
###
### For cert8 (legacy - DBM)
###
for certDB in $(find ~/ -name "cert8.db")
do
certdir=$(dirname ${certDB});
certutil -A -n "${certname}" -t "TCu,Cu,Tu" -i ${certfile} -d dbm:${certdir}
done
###
### For cert9 (SQL)
###
for certDB in $(find ~/ -name "cert9.db")
do
certdir=$(dirname ${certDB});
certutil -A -n "${certname}" -t "TCu,Cu,Tu" -i ${certfile} -d sql:${certdir}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment