Skip to content

Instantly share code, notes, and snippets.

@tonejito
Created March 5, 2014 07:28
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 tonejito/9362715 to your computer and use it in GitHub Desktop.
Save tonejito/9362715 to your computer and use it in GitHub Desktop.
Download and display SSL certificate validity dates issuer and subject
#!/bin/bash -vx
# check-certificate.sh
# Download and display SSL certificate validity dates issuer and subject
# Andres Hernandez - tonejito
PRINTF=printf
OPENSSL=openssl
if [ -n "${1}" ]
then
HOST=${1}
else
HOST=localhost
fi
if [ -n "${2}" ]
then
PORT=${2}
else
PORT=443
fi
$PRINTF "" | \
$OPENSSL s_client -showcerts -connect $HOST:$PORT | \
$OPENSSL x509 -noout -issuer -subject -dates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment