Skip to content

Instantly share code, notes, and snippets.

@boina-n
Created October 24, 2018 13:01
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 boina-n/fc623c78c270fc25f116df63aa399aaf to your computer and use it in GitHub Desktop.
Save boina-n/fc623c78c270fc25f116df63aa399aaf to your computer and use it in GitHub Desktop.
check https certificate
#! /bin/sh
#SRV_LIST="myser.com \
#myserver2.com \
#myserver3.com"
SRV_LIST="$1"
checkcrt(){
SRV=$1
echo "===== $SRV"
openssl s_client -showcerts -connect $SRV:443 > /tmp/CRT_$SRV <<-EOF
EOF
if [ -f /tmp/CRT_$SRV ]
then
openssl x509 -noout -in /tmp/CRT_$SRV -subject
fi
}
for SRV in $SRV_LIST
do
checkcrt $SRV
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment