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 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 | |
| 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ ./get-thumbprint.sh token.actions.githubusercontent.com % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 628 100 628 0 0 2879 0 --:--:-- --:--:-- --:--:-- 2948 6938fd4d98bab03faadb97b34396831e3780aea1