File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11258,6 +11258,12 @@ npn_pre(){
1125811258 fileout "NPN" "WARN" "not tested $OPENSSL doesn't support NPN/SPDY"
1125911259 return 7
1126011260 fi
11261+ if "$TLS13_ONLY"; then
11262+ # https://github.com/openssl/openssl/issues/3665
11263+ pr_warning "There's no such thing as NPN on TLS 1.3-only hosts"
11264+ fileout "NPN" "WARN" "not possible for TLS 1.3-only hosts"
11265+ return 6
11266+ fi
1126111267 return 0
1126211268}
1126311269
@@ -11281,16 +11287,24 @@ alpn_pre(){
1128111287run_npn() {
1128211288 local tmpstr
1128311289 local -i ret=0
11290+ local proto=""
1128411291 local jsonID="NPN"
1128511292
1128611293 [[ -n "$STARTTLS" ]] && return 0
1128711294 "$FAST" && return 0
1128811295 pr_bold " NPN/SPDY "
11296+
1128911297 if ! npn_pre; then
1129011298 outln
1129111299 return 0
1129211300 fi
11293- $OPENSSL s_client $(s_client_options "-connect $NODEIP:$PORT $BUGS $SNI -nextprotoneg "$NPN_PROTOs"") </dev/null 2>$ERRFILE >$TMPFILE
11301+
11302+ # 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
11303+ # TLS13_ONLY is tested here again, just to be sure, see npn_pre
11304+ if "$HAS_TLS13" && ! $TLS13_ONLY ]] ; then
11305+ proto="-no_tls1_3"
11306+ fi
11307+ $OPENSSL s_client $(s_client_options "$proto -connect $NODEIP:$PORT $BUGS $SNI -nextprotoneg "$NPN_PROTOs"") </dev/null 2>$ERRFILE >$TMPFILE
1129411308 [[ $? -ne 0 ]] && ret=1
1129511309 tmpstr="$(grep -a '^Protocols' $TMPFILE | sed 's/Protocols.*: //')"
1129611310 if [[ -z "$tmpstr" ]] || [[ "$tmpstr" == " " ]]; then
You can’t perform that action at this time.
0 commit comments