Created
March 11, 2024 03:18
-
-
Save amirkdv/ca3c3c78fff3db803f0d6d7b491447a7 to your computer and use it in GitHub Desktop.
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 | |
# | |
# Usage: | |
# $ inspect-tls-cert.sh facebook.com | |
set -eux | |
server=${1:-"stripe.com"} | |
certfile=/tmp/${server}.cert | |
openssl_client_connect="openssl s_client -connect ${server}:443 -servername ${server}" | |
echo "Downloading TLS cert for ${server} to ${certfile}" | |
echo | ${openssl_client_connect} | openssl x509 > ${certfile} | |
echo "Inspecting TLS cert at ${certfile}" | |
openssl x509 -in ${certfile} -text -noout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment