Created
September 25, 2017 08:16
-
-
Save ChatchaiJ/aef884d5049daab364eaf81d0adf99a0 to your computer and use it in GitHub Desktop.
Using openssl's s_client for printing certificates information from a web site
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 | |
[ -z "$1" ] && echo "Usage: $0 www.example.com" && exit | |
SERVERNAME="$1" | |
echo |\ | |
openssl s_client \ | |
-showcerts \ | |
-servername $SERVERNAME \ | |
-connect $SERVERNAME:443 2>/dev/null |\ | |
openssl x509 \ | |
-inform pem \ | |
-noout \ | |
-text | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment