diff --git a/testssl.sh b/testssl.sh index 0ae0160..fa05197 100755 --- a/testssl.sh +++ b/testssl.sh @@ -10926,6 +10926,40 @@ run_fs() { [[ $i -eq $high ]] && break supported_curve[i]=true done + # Versions of TLS prior to 1.3 close the connection if the client does not support the curve + # used in the certificate. The easiest solution is to move the curves to the end of the list. + # instead of removing them from the ClientHello. This is only needed if there is no RSA certificate. + if (! "$HAS_TLS13" || [[ "$proto" == "-no_tls1_3" ]]) && [[ ! "$ecdhe_cipher_list" == *RSA* ]]; then + while true; do + curves_to_test="" + for (( i=low; i < high; i++ )); do + "${ossl_supported[i]}" && ! "${supported_curve[i]}" && curves_to_test+=":${curves_ossl[i]}" + done + [[ -z "$curves_to_test" ]] && break + for (( i=low; i < high; i++ )); do + "${supported_curve[i]}" && curves_to_test+=":${curves_ossl[i]}" + done + $OPENSSL s_client $(s_client_options "$proto -cipher "\'${ecdhe_cipher_list:1}\'" -ciphersuites "\'${tls13_cipher_list:1}\'" -curves "${curves_to_test:1}" $STARTTLS $BUGS -connect $NODEIP:$PORT $PROXY $SNI") &>$TMPFILE