Last active
December 10, 2015 20:38
-
-
Save didip/4489837 to your computer and use it in GitHub Desktop.
Script to download and add self-signed SSL cert exception to OS X keychain.
Usage: ./add-self-signed-cert.sh www.example.com
This file contains 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 | |
DOMAIN=$1; | |
echo -n | openssl s_client -connect $DOMAIN:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/$DOMAIN.cert && open /tmp/$DOMAIN.cert | |
# Notes: | |
# 1. After you ran this script, simple refresh your stubborn browser. i.e. Chrome. | |
# 2. When you are done, don't forget to delete /tmp/$DOMAIN.cert file. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment