Skip to content

Instantly share code, notes, and snippets.

@evanscottgray
Created July 14, 2014 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evanscottgray/96173341263b2f8309fc to your computer and use it in GitHub Desktop.
Save evanscottgray/96173341263b2f8309fc to your computer and use it in GitHub Desktop.
ca cert lookup
#!/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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment