mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-05 16:29:45 +01:00
Fix bash 3 support
Mac OS X ships with bash 3, not 4. The case statement fallthrough and continue operators were added in bash 4.
This commit is contained in:
parent
1954f9eaa8
commit
298a91d743
25
testssl.sh
25
testssl.sh
@ -3975,20 +3975,22 @@ determine_service() {
|
|||||||
else
|
else
|
||||||
protocol=$(echo "$1" | sed 's/s$//') # strip trailing s in ftp(s), smtp(s), pop3(s), imap(s), ldap(s), telnet(s)
|
protocol=$(echo "$1" | sed 's/s$//') # strip trailing s in ftp(s), smtp(s), pop3(s), imap(s), ldap(s), telnet(s)
|
||||||
case "$protocol" in
|
case "$protocol" in
|
||||||
xmpp) # for XMPP, openssl has a problem using -connect $NODEIP:$PORT. thus we use -connect $NODE:$PORT instead!
|
|
||||||
NODEIP="$NODE"
|
|
||||||
;&
|
|
||||||
ftp|smtp|pop3|imap|xmpp|telnet|ldap)
|
ftp|smtp|pop3|imap|xmpp|telnet|ldap)
|
||||||
STARTTLS="-starttls $protocol"
|
STARTTLS="-starttls $protocol"
|
||||||
SNI=""
|
SNI=""
|
||||||
if [[ -n "$XMPP_HOST" ]] && [[ $protocol == "xmpp" ]] ; then
|
if [[ $protocol == "xmpp" ]] ; then
|
||||||
if ! $OPENSSL s_client --help 2>&1 | grep -q xmpphost; then
|
# for XMPP, openssl has a problem using -connect $NODEIP:$PORT. thus we use -connect $NODE:$PORT instead!
|
||||||
outln
|
NODEIP="$NODE"
|
||||||
pr_magentaln " Local problem: Your $OPENSSL does not support the \"-xmpphost\" option"
|
|
||||||
exit 1
|
if [[ -n "$XMPP_HOST" ]] ; then
|
||||||
|
if ! $OPENSSL s_client --help 2>&1 | grep -q xmpphost; then
|
||||||
|
outln
|
||||||
|
pr_magentaln " Local problem: Your $OPENSSL does not support the \"-xmpphost\" option"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
STARTTLS="$STARTTLS -xmpphost $XMPP_HOST" # it's a hack -- instead of changing calls all over the place
|
||||||
|
# see http://xmpp.org/rfcs/rfc3920.html
|
||||||
fi
|
fi
|
||||||
STARTTLS="$STARTTLS -xmpphost $XMPP_HOST" # it's a hack -- instead of changing calls all over the place
|
|
||||||
# see http://xmpp.org/rfcs/rfc3920.html
|
|
||||||
fi
|
fi
|
||||||
$OPENSSL s_client -connect $NODEIP:$PORT $PROXY $STARTTLS 2>/dev/null >$TMPFILE </dev/null
|
$OPENSSL s_client -connect $NODEIP:$PORT $PROXY $STARTTLS 2>/dev/null >$TMPFILE </dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
@ -4001,7 +4003,8 @@ determine_service() {
|
|||||||
[[ -n "$XMPP_HOST" ]] && printf " (XMPP domain=\'$XMPP_HOST\')"
|
[[ -n "$XMPP_HOST" ]] && printf " (XMPP domain=\'$XMPP_HOST\')"
|
||||||
outln
|
outln
|
||||||
;;
|
;;
|
||||||
*) pr_litemagentaln "momentarily only ftp, smtp, pop3, imap, xmpp and telnet, ldap allowed" >&2
|
*)
|
||||||
|
pr_litemagentaln "momentarily only ftp, smtp, pop3, imap, xmpp, telnet and ldap allowed" >&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user