Last active
September 11, 2019 18:33
-
-
Save jeffrade/d3faaac67c29503bb71963d2db6a9e5c to your computer and use it in GitHub Desktop.
Bash script to check certificate information - uses openssl.
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 | |
if [ -z "$1" ] | |
then | |
echo "Please supply a domain, e.g. www.example.com" | |
exit 1 | |
fi | |
echo | openssl s_client -servername $1 -connect $1:443 2>/dev/null | openssl x509 -text | |
echo "Saving public ./cert.pem..." | |
openssl s_client -showcerts -connect $1:443 </dev/null 2>/dev/null | openssl x509 -outform PEM > cert.pem | |
echo "Done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment