Friday, October 14, 2011

Import Self Signed Certs

Day three of using self signed certs and I was tired of telling chrome to accept it. Under the wrench menu there was an import certificate process. However, for Ubunutu, what it really needed was importing them into the OS keystore

First step, install the libnss3-tools:
sudo apt-get install libnss3-tools

There is a mention on that page linked above that says the cert needs to be imported as a CA due to a bug. On Natty Ubuntu it was not necessary. I put the following function in my .bashrc

function trustCert() {
[ $# -ne 2 ] && echo "you need to provide [certificate_nickname] and [certificate_filename]" && return 1
certutil -d sql:$HOME/.pki/nssdb -A -t "P,," -n $1 -i $2
}