Skip to content

Instantly share code, notes, and snippets.

@entr
Created January 5, 2017 11:44
Show Gist options
  • Save entr/f9e7d31881f8639a288ea36826a06eb2 to your computer and use it in GitHub Desktop.
Save entr/f9e7d31881f8639a288ea36826a06eb2 to your computer and use it in GitHub Desktop.
Adding SSL certificates to Google Chrome Linux (Ubuntu)
#!/bin/sh
#
# usage: import-cert.sh remote.host.name [port]
# credits: http://blog.avirtualhome.com/adding-ssl-certificates-to-google-chrome-linux-ubuntu/
#
REMHOST=$1
REMPORT=${2:-443}
exec 6>&1
exec > $REMHOST
echo | openssl s_client -connect ${REMHOST}:${REMPORT} 2>&1 |sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'
certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "$REMHOST" -i $REMHOST
exec 1>&6 6>&-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment