Created
December 9, 2014 05:30
-
-
Save holysugar/b9a6dbde0fa89133adbd to your computer and use it in GitHub Desktop.
SSL証明書の期限を表示する
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/sh | |
HOST=$1 | |
if [ -z "$HOST" ]; then | |
echo "$0 host [port]" | |
exit 1 | |
fi | |
PORT=${2:-443} | |
openssl s_client -tls1 -connect $HOST:$PORT 2>&1 < /dev/null | openssl x509 -enddate | awk -F '=' '/^notAfter/{ print $2 }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment