Skip to content

Instantly share code, notes, and snippets.

@trobert2
Created November 16, 2022 09:15
Show Gist options
  • Save trobert2/c4bb24c341a52688e4728160cd4cdd65 to your computer and use it in GitHub Desktop.
Save trobert2/c4bb24c341a52688e4728160cd4cdd65 to your computer and use it in GitHub Desktop.
Get ssl thumbprint of any domain
#!/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"
@trobert2
Copy link
Author

$ ./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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment