Created
March 12, 2018 03:12
-
-
Save alecdwm/7f89077ebf096aa236fbbd0f4753a8b2 to your computer and use it in GitHub Desktop.
Fetch the sha256 fingerprint of a TCP server's TLS cert
This file contains 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 | |
# Works for any TLS-enabled TCP server, but originally intended for | |
# fetching the sha256 fingerprint of an irc server's TLS cert | |
# when the server refuses to use certificates from a trusted CA. | |
# | |
# Example: | |
# $ get-sha256-fingerprint.sh irc.owls.io:6697 | |
openssl s_client -connect "$1" < /dev/null 2>/dev/null | openssl x509 -fingerprint -sha256 -noout -in /dev/stdin | sed -e "s/://g" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment