FIX #1009 and leftover fix for #988

In cases where HTTP/2 was the only ALPN protocol, the
JSON output was missing the finding as the additional
protocol was empty.

This fix tests whether there's an additional protcol
and only calls fileout() if there's one.
This commit is contained in:
Dirk 2018-03-17 20:37:00 +01:00
parent 4eb6ab5976
commit c91a771465

View File

@ -8104,7 +8104,7 @@ run_alpn() {
else else
out ", " out ", "
fi fi
# only h2 is what browser need to use HTTP/2.0 and brings a security benefit # only h2 is what browser need to use HTTP/2.0 and brings a security,privacy and performance benefit
if [[ "$proto" == "h2" ]]; then if [[ "$proto" == "h2" ]]; then
pr_svrty_good "$proto" pr_svrty_good "$proto"
fileout "${jsonID}_HTTP2" "OK" "$proto" fileout "${jsonID}_HTTP2" "OK" "$proto"
@ -8116,7 +8116,8 @@ run_alpn() {
done done
if $has_alpn_proto; then if $has_alpn_proto; then
outln " (offered)" outln " (offered)"
fileout "$jsonID" "INFO" "$alpn_finding" # if h2 is not the only protocol:
[[ -n "$alpn_finding" ]] && fileout "$jsonID" "INFO" "$alpn_finding"
else else
outln "not offered" outln "not offered"
fileout "$jsonID" "INFO" "not offered" fileout "$jsonID" "INFO" "not offered"