Allow starttls connections
authorJoerg Jaspert <joerg@debian.org>
Tue, 15 Nov 2016 22:07:23 +0000 (23:07 +0100)
committerJoerg Jaspert <joerg@debian.org>
Tue, 15 Nov 2016 22:07:23 +0000 (23:07 +0100)
.zsh/functions/telnets

index 9f7c424..423d5f7 100644 (file)
@@ -2,10 +2,15 @@
 
 host=${1:-""}
 port=${2:-"443"}
+proto=${3:-""}
 
-if [[ $host = "" ]]; then
+if [[ -z $host ]]; then
     echo "Missing host argument"
     return
 fi
 
-openssl s_client -host ${host} -port ${port}
+if [[ -z ${proto} ]]; then
+    openssl s_client -host ${host} -port ${port}
+else
+    openssl s_client -host ${host} -port ${port} -starttls ${proto}
+fi
\ No newline at end of file