Created
October 24, 2016 18:00
-
-
Save kckrinke/9f96847b7a15438bcc162db907b4dd6f to your computer and use it in GitHub Desktop.
Retrieve SSL (public) certificate from a remote host
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 | |
if [ -z "$1" ] | |
then | |
echo "usage: $(basename $0) <server:port>" | |
exit 1 | |
fi | |
echo | openssl s_client -connect "$1" 2>&1 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment