Skip to content

Instantly share code, notes, and snippets.

@snobu
Created May 12, 2016 07:47
Show Gist options
  • Select an option

  • Save snobu/e08b5563a9366ca92090f4b39d781142 to your computer and use it in GitHub Desktop.

Select an option

Save snobu/e08b5563a9366ca92090f4b39d781142 to your computer and use it in GitHub Desktop.
Count certs in TLS handshake
while true
do
if [ $(openssl s_client -showcerts -connect $1:443 -servername $1 2>&1 < /dev/null | grep "BEGIN CERTIFICATE" | wc -l) != 2 ]
then echo "!!!INTERMEDIATE NOT SERVED!!! OpenSSL exit code = $?"
fi
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment