Created
June 23, 2013 14:43
-
-
Save zertrin/5845268 to your computer and use it in GitHub Desktop.
A script to retrieve a SSL certificate from a server
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/sh | |
# | |
# A script to retrieve a SSL certificate from a server | |
# usage: retrieve-cert.sh remote.host.name [port] | |
# | |
REMHOST=$1 | |
REMPORT=${2:-443} | |
echo |\ | |
openssl s_client -connect ${REMHOST}:${REMPORT} 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