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