Skip to content

Instantly share code, notes, and snippets.

@joshpollara
Created February 10, 2023 02:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshpollara/423cc7455571b3b56798253d9653f2b7 to your computer and use it in GitHub Desktop.
Save joshpollara/423cc7455571b3b56798253d9653f2b7 to your computer and use it in GitHub Desktop.
calculate github thumbprint
#!/usr/bin/env bash
HOST=$(curl -s https://vstoken.actions.githubusercontent.com/.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"$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment