Skip to content

Instantly share code, notes, and snippets.

@hummus
Created October 6, 2017 22:00
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 hummus/7f80865ca5ef80f5880d308acba3d46a to your computer and use it in GitHub Desktop.
Save hummus/7f80865ca5ef80f5880d308acba3d46a to your computer and use it in GitHub Desktop.
# request CA via the host
openssl s_client -showcerts -connect www.example.com:443 < /dev/null | openssl x509 -outform PEM 2>/dev/null
# awk statement for wrangling
awk '/----BEGIN CERTIFICATE----/ { flag = 1; ++ctr } flag && ctr < 2 { print } /-----END CERTIFICATE-----/ { flag = 0 }' out | openssl x509 -noout -sha256 -fingerprint
# good luck though, not all servers give or have the CA accessible wtf.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment