mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-30 12:21:17 +01:00
Merge pull request #2635 from testssl/fix_2633
Fix bug when legacy NPN is tested against a TLS 1.3 host
This commit is contained in:
commit
d115b2ebbf
16
testssl.sh
16
testssl.sh
@ -11258,6 +11258,12 @@ npn_pre(){
|
|||||||
fileout "NPN" "WARN" "not tested $OPENSSL doesn't support NPN/SPDY"
|
fileout "NPN" "WARN" "not tested $OPENSSL doesn't support NPN/SPDY"
|
||||||
return 7
|
return 7
|
||||||
fi
|
fi
|
||||||
|
if "$TLS13_ONLY"; then
|
||||||
|
# https://github.com/openssl/openssl/issues/3665
|
||||||
|
pr_warning "There's no such thing as NPN on TLS 1.3-only hosts"
|
||||||
|
fileout "NPN" "WARN" "not possible for TLS 1.3-only hosts"
|
||||||
|
return 6
|
||||||
|
fi
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -11281,16 +11287,24 @@ alpn_pre(){
|
|||||||
run_npn() {
|
run_npn() {
|
||||||
local tmpstr
|
local tmpstr
|
||||||
local -i ret=0
|
local -i ret=0
|
||||||
|
local proto=""
|
||||||
local jsonID="NPN"
|
local jsonID="NPN"
|
||||||
|
|
||||||
[[ -n "$STARTTLS" ]] && return 0
|
[[ -n "$STARTTLS" ]] && return 0
|
||||||
"$FAST" && return 0
|
"$FAST" && return 0
|
||||||
pr_bold " NPN/SPDY "
|
pr_bold " NPN/SPDY "
|
||||||
|
|
||||||
if ! npn_pre; then
|
if ! npn_pre; then
|
||||||
outln
|
outln
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
$OPENSSL s_client $(s_client_options "-connect $NODEIP:$PORT $BUGS $SNI -nextprotoneg "$NPN_PROTOs"") </dev/null 2>$ERRFILE >$TMPFILE
|
|
||||||
|
# TLS 1.3 s_client doesn't support -nextprotoneg when connecting with TLS 1.3. So we need to make sure it won't be used
|
||||||
|
# TLS13_ONLY is tested here again, just to be sure, see npn_pre
|
||||||
|
if "$HAS_TLS13" && ! $TLS13_ONLY ]] ; then
|
||||||
|
proto="-no_tls1_3"
|
||||||
|
fi
|
||||||
|
$OPENSSL s_client $(s_client_options "$proto -connect $NODEIP:$PORT $BUGS $SNI -nextprotoneg "$NPN_PROTOs"") </dev/null 2>$ERRFILE >$TMPFILE
|
||||||
[[ $? -ne 0 ]] && ret=1
|
[[ $? -ne 0 ]] && ret=1
|
||||||
tmpstr="$(grep -a '^Protocols' $TMPFILE | sed 's/Protocols.*: //')"
|
tmpstr="$(grep -a '^Protocols' $TMPFILE | sed 's/Protocols.*: //')"
|
||||||
if [[ -z "$tmpstr" ]] || [[ "$tmpstr" == " " ]]; then
|
if [[ -z "$tmpstr" ]] || [[ "$tmpstr" == " " ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user