Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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