Skip to content

Commit 61c2be8

Browse files
author
w4ntun
committed
PR properly rebased
1 parent a701541 commit 61c2be8

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
@@ -22982,10 +22982,10 @@ datebanner() {
2298222982
local scan_time_f=""
2298322983
local node_banner=""
2298422984

22985-
if [[ -n "$PROXY" ]] && "$DNS_VIA_PROXY"; then
22986-
node_banner="$NODE:$PORT"
22985+
if [[ -n "PROXY" ]] && $DNS_VIA_PROXY;then
22986+
node_banner="$NODE:$PORT"
2298722987
else
22988-
node_banner="$NODEIP:$PORT ($NODE)"
22988+
node_banner="$NODEIP:$PORT ($NODE)"
2298922989
fi
2299022990

2299122991
if [[ "$1" =~ Done ]] ; then
@@ -24950,30 +24950,24 @@ lets_roll() {
2495024950
[[ -z "$NODE" ]] && parse_hn_port "${URI}" # NODE, URL_PATH, PORT, IPADDRs and IP46ADDR is set now
2495124951
prepare_logging
2495224952

24953-
if [[ -n "$PROXY" ]] && $DNS_VIA_PROXY; then
24954-
NODEIP="$NODE"
24955-
lets_roll "${STARTTLS_PROTOCOL}"
24956-
RET=$?
24957-
else
24958-
determine_ip_addresses
24959-
if [[ $(count_words "$IPADDRs") -gt 1 ]]; then # we have more than one ipv4 address to check
24960-
MULTIPLE_CHECKS=true
24961-
pr_bold "Testing all IPv4 addresses (port $PORT): "; outln "$IPADDRs"
24962-
for ip in $IPADDRs; do
24963-
draw_line "-" $((TERM_WIDTH * 2 / 3))
24964-
outln
24965-
NODEIP="$ip"
24966-
lets_roll "${STARTTLS_PROTOCOL}"
24967-
RET=$((RET + $?)) # RET value per IP address
24968-
done
24953+
determine_ip_addresses
24954+
if [[ $(count_words "$IPADDRs") -gt 1 ]]; then # we have more than one ipv4 address to check
24955+
MULTIPLE_CHECKS=true
24956+
pr_bold "Testing all IPv4 addresses (port $PORT): "; outln "$IPADDRs"
24957+
for ip in $IPADDRs; do
2496924958
draw_line "-" $((TERM_WIDTH * 2 / 3))
2497024959
outln
24971-
pr_bold "Done testing now all IP addresses (on port $PORT): "; outln "$IPADDRs"
24972-
else # Just 1x ip4v to check, applies also if CMDLINE_IP was supplied
24973-
NODEIP="$IPADDRs"
24960+
NODEIP="$ip"
2497424961
lets_roll "${STARTTLS_PROTOCOL}"
24975-
RET=$?
24976-
fi
24962+
RET=$((RET + $?)) # RET value per IP address
24963+
done
24964+
draw_line "-" $((TERM_WIDTH * 2 / 3))
24965+
outln
24966+
pr_bold "Done testing now all IP addresses (on port $PORT): "; outln "$IPADDRs"
24967+
else # Just 1x ip4v to check, applies also if CMDLINE_IP was supplied
24968+
NODEIP="$IPADDRs"
24969+
lets_roll "${STARTTLS_PROTOCOL}"
24970+
RET=$?
2497724971
fi
2497824972

2497924973
exit $RET

0 commit comments

Comments
 (0)