Bash script that shows the dates of SSL certificates

Posted: November 22nd, 2011 | Author: | Filed under: programming | No Comments »

After a bit of trickery and combining different Google hits I came up with this script:

for CERT in domain1:443 domain2:7431 domain3:443
  echo $CERT
  echo "GET /" | openssl s_client -connect ${CERT} 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | openssl x509 -noout -subject -dates

Leave a Reply

  • Receive notifications via email of new comments on this post