Download and display SSL certificate validity dates issuer and subject
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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