Skip to content

Commit ea3cc37

Browse files
committed
handle UI output better when conn to port 80 failed
1 parent 0d63a56 commit ea3cc37

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

testssl.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17707,16 +17707,22 @@ run_opossum() {
1770717707
uri=${URI/https:\/\//}
1770817708
response=$(http_head_printf http://${uri} 'Upgrade: TLS/1.0\r\n\r\nClose\r\n')
1770917709
# In any case we use $response but we handle the return codes
17710-
case $? in
17711-
0) ret=0 ;;
17712-
1|3) ret=7 ;; # got stuck
17713-
esac
17710+
# 0: connection was fine, 1 or 3: no http connection
17711+
ret=$?
1771417712
if [[ $response =~ Upgrade:\ TLS ]]; then
1771517713
prln_svrty_high "VULNERABLE (NOT ok)"
1771617714
fileout "$jsonID" "CRITICAL" "VULNERABLE" "$cve" "$cwe" "$hint"
17717-
else
17715+
elif [[ $ret -eq 0 ]]; then
1771817716
prln_svrty_good "not vulnerable (OK)"
17719-
fileout "$jsonID" "OK" "not vulnerable $append" "$cve" "$cwe"
17717+
fileout "$jsonID" "OK" "not vulnerable" "$cve" "$cwe"
17718+
else
17719+
if [[ $ret -eq 3 ]]; then
17720+
prln_local_problem "direct connection to port 80 failed, better try without proxy"
17721+
fileout "$jsonID" "WARN" "direct connection to port 80 failed, try w/o no proxy" "$cve" "$cwe"
17722+
else
17723+
outln "connection to port 80 failed"
17724+
fileout "$jsonID" "INFO" "connection to port 80 failed" "$cve" "$cwe"
17725+
fi
1772017726
fi
1772117727
;;
1772217728
IMAP|FTP|POP3|SMTP|LMTP|NNTP)

0 commit comments

Comments
 (0)