Created
May 30, 2015 16:40
-
-
Save jqr/75d6217e76101a30805a to your computer and use it in GitHub Desktop.
Easy command line SSL certificate fingerprinting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!#!/bin/bash | |
| if [ $1 ]; then | |
| echo -e "GET / HTTP\1.1\n" | openssl s_client -connect $1:443 2> /dev/null | openssl x509 -noout -fingerprint | cut -f2 -d'=' | head -n 1 2> /dev/null | |
| else | |
| echo "Usage: $0 <host>" | |
| echo "Generates an SSL fingerprint for a host. Useful in comparing certificate changes." | |
| echo | |
| echo "Examples:" | |
| echo " $0 google.com" | |
| echo " $0 amazon.com" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment