summaryrefslogtreecommitdiff
path: root/metadata/scripts/cert-retrieve.sh
blob: 5440b0f885fd3fae6862f0d615798cb5b4e6d14d (plain)
1
2
3
4
5
6
7
8
#!/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'