OpenSSL: Retrieve remote SSL certificate

security Add comments

The following small script has been copied over from madboa.com:

#!/bin/sh
#
# 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’

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in