Skip to content

Instantly share code, notes, and snippets.

@estahn
Last active June 22, 2016 03:43
Show Gist options
  • Save estahn/dd5cf8a8fb8a9c0b0fb6a6190383d39d to your computer and use it in GitHub Desktop.
Save estahn/dd5cf8a8fb8a9c0b0fb6a6190383d39d to your computer and use it in GitHub Desktop.
Check SSL on all ELBs
#!/bin/sh
ELBS=`aws elb describe-load-balancers | jq -r '.LoadBalancerDescriptions[] | select(.ListenerDescriptions[].Listener.SSLCertificateId) | .DNSName'`
for elb in ${ELBS}; do
OUTPUT=`echo | timeout 2 openssl s_client -connect ${elb}:443 2>/dev/null | openssl x509 -noout -enddate 2> /dev/null`
echo "${elb};${OUTPUT}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment