Skip to content

Commit 0e90d55

Browse files
author
w4ntun
committed
PR properly rebased
1 parent 459ccee commit 0e90d55

File tree

1 file changed

+19
-25
lines changed

1 file changed

+19
-25
lines changed

testssl.sh

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ TESTSSL_INSTALL_DIR="${TESTSSL_INSTALL_DIR:-""}" # If you run testssl.sh and it
197197
CA_BUNDLES_PATH="${CA_BUNDLES_PATH:-""}" # You can have your CA stores some place else
198198
EXPERIMENTAL=${EXPERIMENTAL:-false} # a development hook which allows us to disable code
199199
PROXY_WAIT=${PROXY_WAIT:-20} # waiting at max 20 seconds for socket reply through proxy
200-
DNS_VIA_PROXY=${DNS_VIA_PROXY:-false} # do DNS lookups via proxy. --ip=proxy reverses this
200+
DNS_VIA_PROXY=${DNS_VIA_PROXY:-true} # do DNS lookups via proxy. --ip=* reverses this
201201
IGN_OCSP_PROXY=${IGN_OCSP_PROXY:-false} # Also when --proxy is supplied it is ignored when testing for revocation via OCSP via --phone-out
202202
HEADER_MAXSLEEP=${HEADER_MAXSLEEP:-5} # we wait this long before killing the process to retrieve a service banner / http header
203203
MAX_SOCKET_FAIL=${MAX_SOCKET_FAIL:-2} # If this many failures for TCP socket connects are reached we terminate
@@ -22848,10 +22848,10 @@ datebanner() {
2284822848
local scan_time_f=""
2284922849
local node_banner=""
2285022850

22851-
if [[ -n "$PROXY" ]] && "$DNS_VIA_PROXY"; then
22852-
node_banner="$NODE:$PORT"
22851+
if [[ -n "PROXY" ]] && $DNS_VIA_PROXY;then
22852+
node_banner="$NODE:$PORT"
2285322853
else
22854-
node_banner="$NODEIP:$PORT ($NODE)"
22854+
node_banner="$NODEIP:$PORT ($NODE)"
2285522855
fi
2285622856

2285722857
if [[ "$1" =~ Done ]] ; then
@@ -24816,30 +24816,24 @@ lets_roll() {
2481624816
[[ -z "$NODE" ]] && parse_hn_port "${URI}" # NODE, URL_PATH, PORT, IPADDRs and IP46ADDR is set now
2481724817
prepare_logging
2481824818

24819-
if [[ -n "$PROXY" ]] && $DNS_VIA_PROXY; then
24820-
NODEIP="$NODE"
24821-
lets_roll "${STARTTLS_PROTOCOL}"
24822-
RET=$?
24823-
else
24824-
determine_ip_addresses
24825-
if [[ $(count_words "$IPADDRs") -gt 1 ]]; then # we have more than one ipv4 address to check
24826-
MULTIPLE_CHECKS=true
24827-
pr_bold "Testing all IPv4 addresses (port $PORT): "; outln "$IPADDRs"
24828-
for ip in $IPADDRs; do
24829-
draw_line "-" $((TERM_WIDTH * 2 / 3))
24830-
outln
24831-
NODEIP="$ip"
24832-
lets_roll "${STARTTLS_PROTOCOL}"
24833-
RET=$((RET + $?)) # RET value per IP address
24834-
done
24819+
determine_ip_addresses
24820+
if [[ $(count_words "$IPADDRs") -gt 1 ]]; then # we have more than one ipv4 address to check
24821+
MULTIPLE_CHECKS=true
24822+
pr_bold "Testing all IPv4 addresses (port $PORT): "; outln "$IPADDRs"
24823+
for ip in $IPADDRs; do
2483524824
draw_line "-" $((TERM_WIDTH * 2 / 3))
2483624825
outln
24837-
pr_bold "Done testing now all IP addresses (on port $PORT): "; outln "$IPADDRs"
24838-
else # Just 1x ip4v to check, applies also if CMDLINE_IP was supplied
24839-
NODEIP="$IPADDRs"
24826+
NODEIP="$ip"
2484024827
lets_roll "${STARTTLS_PROTOCOL}"
24841-
RET=$?
24842-
fi
24828+
RET=$((RET + $?)) # RET value per IP address
24829+
done
24830+
draw_line "-" $((TERM_WIDTH * 2 / 3))
24831+
outln
24832+
pr_bold "Done testing now all IP addresses (on port $PORT): "; outln "$IPADDRs"
24833+
else # Just 1x ip4v to check, applies also if CMDLINE_IP was supplied
24834+
NODEIP="$IPADDRs"
24835+
lets_roll "${STARTTLS_PROTOCOL}"
24836+
RET=$?
2484324837
fi
2484424838

2484524839
exit $RET

0 commit comments

Comments
 (0)