Skip to content

Instantly share code, notes, and snippets.

View joshpollara's full-sized avatar

Josh Pollara joshpollara

  • Amsterdam, NL
View GitHub Profile
@joshpollara
joshpollara / calculate-github-thumbprint.sh
Created February 10, 2023 02:53
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"$