Skip to content

Commit

Permalink
Fix json/csv output when STARTTLS problem is passed back (3.0)
Browse files Browse the repository at this point in the history
In rare cases testssl.sh writes to the terminal output "likely not offered" but misses the "likely" in the json/csv output.

This fixes #2575 for the 3.0 branch by adding that word and amending the return value 4 with a comment.
  • Loading branch information
drwetter committed Oct 14, 2024
1 parent d248451 commit c2ed4d5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions testssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5050,7 +5050,8 @@ run_protocols() {
fileout "$jsonID" "OK" "not offered"
add_tls_offered ssl2 no
;;
4) out "likely "; pr_svrty_best "not offered (OK), "
4) # STARTTLS problem
out "likely "; pr_svrty_best "not offered (OK), "
fileout "$jsonID" "OK" "likely not offered"
add_tls_offered ssl2 no
pr_warning "received 4xx/5xx after STARTTLS handshake"; outln "$debug_recomm"
Expand Down Expand Up @@ -5220,7 +5221,7 @@ run_protocols() {
pr_warning "TLS downgraded to STARTTLS plaintext"; outln
fileout "$jsonID" "WARN" "TLS downgraded to STARTTLS plaintext"
;;
4) out "likely not offered, "
4) out "likely not offered, " # STARTTLS problem
fileout "$jsonID" "INFO" "likely not offered"
add_tls_offered tls1 no
pr_warning "received 4xx/5xx after STARTTLS handshake"; outln "$debug_recomm"
Expand Down Expand Up @@ -5301,8 +5302,8 @@ run_protocols() {
pr_warning "TLS downgraded to STARTTLS plaintext"; outln
fileout "$jsonID" "WARN" "TLS downgraded to STARTTLS plaintext"
;;
4) out "likely not offered, "
fileout "$jsonID" "INFO" "not offered"
4) out "likely not offered, " # STARTTLS problem
fileout "$jsonID" "INFO" "likely not offered"
add_tls_offered tls1_1 no
pr_warning "received 4xx/5xx after STARTTLS handshake"; outln "$debug_recomm"
fileout "$jsonID" "WARN" "received 4xx/5xx after STARTTLS handshake${debug_recomm}"
Expand Down Expand Up @@ -5566,8 +5567,8 @@ run_protocols() {
pr_warning "TLS downgraded to STARTTLS plaintext"; outln
fileout "$jsonID" "WARN" "TLS downgraded to STARTTLS plaintext"
;;
4) out "likely not offered, "
fileout "$jsonID" "INFO" "not offered"
4) out "likely not offered, " # STARTTLS problem
fileout "$jsonID" "INFO" "likely not offered"
add_tls_offered tls1_3 no
pr_warning "received 4xx/5xx after STARTTLS handshake"; outln "$debug_recomm"
fileout "$jsonID" "WARN" "received 4xx/5xx after STARTTLS handshake${debug_recomm}"
Expand Down

0 comments on commit c2ed4d5

Please sign in to comment.