Created
November 16, 2022 09:15
-
-
Save trobert2/c4bb24c341a52688e4728160cd4cdd65 to your computer and use it in GitHub Desktop.
Get ssl thumbprint of any domain
This file contains 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 | |
HOST=$(curl https://$1/.well-known/openid-configuration \ | |
| jq -r '.jwks_uri | split("/")[2]') | |
echo | openssl s_client -servername $HOST -showcerts -connect $HOST:443 2> /dev/null \ | |
| sed -n -e '/BEGIN/h' -e '/BEGIN/,/END/H' -e '$x' -e '$p' | tail +2 \ | |
| openssl x509 -fingerprint -noout \ | |
| sed -e "s/.*=//" -e "s/://g" \ | |
| tr "ABCDEF" "abcdef" |
Author
trobert2
commented
Nov 16, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment