From cbd2b4da1e0a26befb2ebc957b6a1275128bd38f Mon Sep 17 00:00:00 2001 From: Dirk Wetter Date: Fri, 10 Jul 2026 13:46:05 +0200 Subject: [PATCH] Add HAS_LDAP to global vars ... and bail out if it is not supported. --- testssl.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/testssl.sh b/testssl.sh index 82e0baa..aad955a 100755 --- a/testssl.sh +++ b/testssl.sh @@ -361,6 +361,7 @@ HAS_ALPN=false HAS_NPN=false HAS_FALLBACK_SCSV=false HAS_PROXY=false +HAS_LDAP=false HAS_XMPP=false HAS_XMPP_SERVER=false HAS_POSTGRES=false @@ -21486,6 +21487,7 @@ find_openssl_binary() { HAS_NPN=false HAS_FALLBACK_SCSV=false HAS_PROXY=false + HAS_LDAP=false HAS_XMPP=false HAS_XMPP_SERVER=false HAS_XMPP_SERVER2=false @@ -21621,6 +21623,8 @@ find_openssl_binary() { grep -q 'xmpp' $s_client_starttls_has && HAS_XMPP=true grep -Eq 'xmpp-server|xmpp\[-server\]' $s_client_starttls_has && HAS_XMPP_SERVER=true + # Seems like LibreSSL on MacOS somehow lost this with 26.5.2? + grep -q 'ldap' $s_client_has && HAS_LDAP=false grep -q 'postgres' $s_client_starttls_has && HAS_POSTGRES=true grep -q 'mysql' $s_client_starttls_has && HAS_MYSQL=true grep -q 'lmtp' $s_client_starttls_has && HAS_LMTP=true @@ -24091,7 +24095,7 @@ determine_service() { if "$HAS_XMPP"; then # small hack -- instead of changing calls all over the place STARTTLS="$STARTTLS -xmpphost $NODE" - else + llelse # If the XMPP name cannot be provided using -xmpphost, # then it needs to be provided to the -connect option NODEIP="$NODE" @@ -24101,6 +24105,11 @@ determine_service() { #FIXME: make use of HAS_XMPP_SERVER2 fatal "Your $OPENSSL does not support the \"-starttls xmpp-server\" option" $ERR_OSSLBIN fi + elif [[ "$protocol" == ldap ]]; then + # Check if openssl version supports postgres. + if ! "$HAS_LDAP"; then + fatal "Your $OPENSSL does not support the \"-starttls ldap\" option" $ERR_OSSLBIN + fi elif [[ "$protocol" == postgres ]]; then # Check if openssl version supports postgres. if ! "$HAS_POSTGRES"; then