Skip to content

Instantly share code, notes, and snippets.

@chrjoh
Created October 9, 2013 11:55
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 chrjoh/6900092 to your computer and use it in GitHub Desktop.
Save chrjoh/6900092 to your computer and use it in GitHub Desktop.
Simple script to check the date of a certificate on a web site
#!/bin/sh
#
# usage: fetch_certificate_and_check_date.sh remote.host.name [port]
#
REMHOST=$1
REMPORT=${2:-443}
echo |\
openssl s_client -connect ${REMHOST}:${REMPORT} 2>&1 |\
sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' |\
openssl x509 -noout -subject -dates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment