Created
September 1, 2017 07:31
-
-
Save m-x-k/1027a7bd51784d746a6d9128066314ea to your computer and use it in GitHub Desktop.
Install self signed certificate on debian machine
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/bash | |
if [ $# -eq 0 ] | |
then | |
echo "./installCertificate.sh <HOSTNAME> <PORT>" | |
exit | |
fi | |
HOSTNAME=$1 | |
PORT=$2 | |
openssl s_client -connect ${HOSTNAME}:${PORT} -showcerts </dev/null 2>/dev/null | openssl x509 -text > /tmp/${HOSTNAME}.crt | |
cp /tmp/${HOSTNAME}.crt /usr/local/share/ca-certificates/ | |
chmod 644 /usr/local/share/ca-certificates/${HOSTNAME}.crt | |
update-ca-certificates --verbose |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment