Skip to content

Instantly share code, notes, and snippets.

@holysugar
Created December 9, 2014 05:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save holysugar/b9a6dbde0fa89133adbd to your computer and use it in GitHub Desktop.
Save holysugar/b9a6dbde0fa89133adbd to your computer and use it in GitHub Desktop.
SSL証明書の期限を表示する
#!/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