Skip to content

Commit fc0aeaa

Browse files
authored
Merge pull request #2384 from drwetter/OPENSSL2_HAS_TLS_1_3
Introducing variable OPENSSL2_HAS_TLS_1_3
2 parents 1e7219f + 79577a8 commit fc0aeaa

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

testssl.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ CIPHERS_BY_STRENGTH_FILE=""
244244
TLS_DATA_FILE="" # mandatory file for socket-based handshakes
245245
OPENSSL="" # If you run this from GitHub it's ~/bin/openssl.$(uname).$(uname -m) otherwise /usr/bin/openssl
246246
OPENSSL2="" # When running from GitHub, this will be openssl version >=1.1.1 (auto determined)
247+
OPENSSL2_HAS_TLS_1_3=false # If we run with supplied binary AND /usr/bin/openssl supports TLS 1.3 this is set to true
247248
OPENSSL_LOCATION=""
248249
IKNOW_FNAME=false
249250
FIRST_FINDING=true # is this the first finding we are outputting to file?
@@ -20109,13 +20110,18 @@ find_openssl_binary() {
2010920110
# Now check whether the standard $OPENSSL has Unix-domain socket and xmpp-server support. If
2011020111
# not check /usr/bin/openssl -- if available. This is more a kludge which we shouldn't use for
2011120112
# every openssl feature. At some point we need to decide which with openssl version we go.
20113+
# We also check, whether there's /usr/bin/openssl which has TLS 1.3
2011220114
OPENSSL2=/usr/bin/openssl
2011320115
if [[ ! "$OSSL_NAME" =~ LibreSSL ]] && [[ ! $OSSL_VER =~ 1.1.1 ]] && [[ ! $OSSL_VER_MAJOR =~ 3 ]]; then
2011420116
if [[ -x $OPENSSL2 ]]; then
2011520117
$OPENSSL2 s_client -help 2>$s_client_has2
2011620118
$OPENSSL2 s_client -starttls foo 2>$s_client_starttls_has2
2011720119
grep -q 'Unix-domain socket' $s_client_has2 && HAS_UDS2=true
2011820120
grep -q 'xmpp-server' $s_client_starttls_has2 && HAS_XMPP_SERVER2=true
20121+
# Likely we don't need the following second check here, see 6 lines above
20122+
if grep -wq 'tls1_3' $s_client_has2 && [[ $OPENSSL != /usr/bin/openssl ]]; then
20123+
OPENSSL2_HAS_TLS_1_3=true
20124+
fi
2011920125
fi
2012020126
fi
2012120127

0 commit comments

Comments
 (0)