summaryrefslogtreecommitdiff
path: root/scripts/cert-retrieve.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/cert-retrieve.sh')
-rwxr-xr-xscripts/cert-retrieve.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/cert-retrieve.sh b/scripts/cert-retrieve.sh
new file mode 100755
index 00000000..5440b0f8
--- /dev/null
+++ b/scripts/cert-retrieve.sh
@@ -0,0 +1,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'