Skip to content

Instantly share code, notes, and snippets.

@abdallah
Created November 4, 2014 16:17
Show Gist options
  • Save abdallah/a5dab950fe0e5f4ad6de to your computer and use it in GitHub Desktop.
Save abdallah/a5dab950fe0e5f4ad6de to your computer and use it in GitHub Desktop.
Check SSL for domain if SHA-1 or SHA-256

Suggested usage

Put certificates list in certs.txt and run:

awk '{ print $3 }' certs.txt | while read d; do bash check_sha256.sh $d 2>/dev/null; done | grep OK
#!/bin/bash
echo -n $1:
if openssl s_client -connect $1:443 < /dev/null 2>/dev/null | openssl x509 -text -in /dev/stdin | grep -iq "sha256"; then echo " OK"; else echo " sha-1"; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment