Created
April 30, 2019 03:43
-
-
Save msuksong/a906afbd7a95d79d4f8089a9045647ff to your computer and use it in GitHub Desktop.
show SSL certificate for a given 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 | |
PORT=443 | |
if [ $# -lt 1 ] || [ $# -gt 2 ]; then | |
echo "Usage: $0 <domain> [<port>] (without https://)" 1>&2 | |
echo " default port is $PORT" 1>&2 | |
exit 1 | |
fi | |
host="$1" | |
port="${2:-$PORT}" | |
echo | openssl s_client -connect "$host":"$port" 2>/dev/null| openssl x509 -noout -text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment