Skip to content

Instantly share code, notes, and snippets.

@jokester
Created December 27, 2018 03: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 jokester/f1bd8f4e549a786b5feda105dba04272 to your computer and use it in GitHub Desktop.
Save jokester/f1bd8f4e549a786b5feda105dba04272 to your computer and use it in GitHub Desktop.
print server certificate (for expiration check and stuff)
#!/usr/bin/env bash
set -ue
if [[ $# -eq 0 ]]; then
echo "USAGE: $0 HOST+"
echo " prints expiration date of https certs with curl"
exit 1
fi
for i in "$@"; do
echo "----------------- https://$i START"
curl -v --silent -I "https://$i/.well_known/whatever.txt" 2>&1 | sed -n '/^* Server certificate/,/> Host/p'
echo "----------------- https://$i END"
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment