Created
November 3, 2016 12:28
-
-
Save uchm4n/42b6b6b044dfd9d145d49559bccf87b6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # This script imports untrusted self signed certificates to you browser | |
| # usage: import-cert.sh remote.host.name [port] | |
| # | |
| 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