Skip to content

Instantly share code, notes, and snippets.

@adborden
Created April 16, 2019 22:32
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 adborden/f0dc1cfa0eb8912ec4def8322860377c to your computer and use it in GitHub Desktop.
Save adborden/f0dc1cfa0eb8912ec4def8322860377c to your computer and use it in GitHub Desktop.
#!/bin/bash
set -o errexit
set -o pipefail
set -o nounset
function check () {
local domain="$1"
certificate_info=$(mktemp)
# openssl doesn't exit 0 in some cases
openssl s_client -connect "${domain}:443" -servername "${domain}" < /dev/null > "$certificate_info" 2>&1 || true
if grep -q DigiCert "$certificate_info"; then
echo ok
else
echo fail
fi
rm -rf "$certificate_info"
}
while read domain; do
echo "$domain"... $(check "$domain")
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment