Created
October 18, 2017 13:17
-
-
Save simontraill/7c50331ddb152f7b918b11d56ee00ccc to your computer and use it in GitHub Desktop.
Install a self signed SSL certificate into the local machine's trust store
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
#!/usr/bin/env bash | |
set -x | |
HOST=$1 | |
if [ -d /etc/pki/ca-trust/source/anchors/ ] ; then | |
echo -n | openssl s_client -connect ${HOST}| sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/pki/ca-trust/source/anchors/ssman.crt | |
update-ca-trust enable | |
update-ca-trust extract | |
elif [ -d /usr/local/share/ca-certificates ] ; then | |
echo -n | openssl s_client -connect ${HOST} | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /usr/local/share/ca-certificates/ssman.crt | |
update-ca-certificates | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment