Created
August 8, 2018 12:40
-
-
Save calebcase/3688f5b2e739f7003b9963d38b3ad651 to your computer and use it in GitHub Desktop.
Basic check of domain's certificate status.
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 | |
set -euo pipefail | |
name=${1?You must set the DNS name to check.} | |
host=${2:-$1} | |
port=${3:-443} | |
# https://www.shellhacks.com/openssl-check-ssl-certificate-expiration-date/ | |
echo | openssl s_client -servername "$name" -connect "$host":"$port" 2>/dev/null | openssl x509 -noout -subject -issuer -startdate -enddate -ocsp_uri -fingerprint -sha256 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment