]> gitweb.fluxo.info Git - ssl-wrapper.git/commitdiff
SSL: options support for retrieve action
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 8 Apr 2017 11:46:53 +0000 (08:46 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 8 Apr 2017 11:46:53 +0000 (08:46 -0300)
ssl

diff --git a/ssl b/ssl
index afd1a4812076ad85325bce652e052191584b5788..ea5bfefe888eceaf023bf8f7b509e6ba6e9f3293 100755 (executable)
--- a/ssl
+++ b/ssl
@@ -15,14 +15,18 @@ function usage {
 }
 
 #
-# usage: retrieve-cert.sh remote.host.name [port]
+# usage: ssl retrieve remote.host.name [port]
+#        ssl retrieve remote.host.name [port] -starttls smtp
 #
 function retrieve {
   REMHOST=$1
   REMPORT=${2:-443}
   
+  shift 2
+  OPTS="$*"
+
   echo |\
-  openssl s_client -connect ${REMHOST}:${REMPORT} 2>&1 |\
+  openssl s_client -connect ${REMHOST}:${REMPORT} $OPTS 2>&1 |\
   sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'
 }