mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-19 15:09:30 +01:00
change basicauth_header variable to a local variable
This commit is contained in:
parent
942cf3d374
commit
51fb849954
@ -18392,6 +18392,7 @@ determine_optimal_proto() {
|
|||||||
determine_service() {
|
determine_service() {
|
||||||
local ua
|
local ua
|
||||||
local protocol
|
local protocol
|
||||||
|
local basicauth_header=""
|
||||||
|
|
||||||
# Check if we can connect to $NODEIP:$PORT. Attention: This ALWAYS uses sockets. Thus timeouts for --ssl-=native do not apply
|
# Check if we can connect to $NODEIP:$PORT. Attention: This ALWAYS uses sockets. Thus timeouts for --ssl-=native do not apply
|
||||||
if ! fd_socket 5; then
|
if ! fd_socket 5; then
|
||||||
@ -18413,14 +18414,13 @@ determine_service() {
|
|||||||
# no STARTTLS.
|
# no STARTTLS.
|
||||||
determine_optimal_sockets_params
|
determine_optimal_sockets_params
|
||||||
determine_optimal_proto
|
determine_optimal_proto
|
||||||
BASIC_AUTH_HEADER=""
|
|
||||||
$SNEAKY && \
|
$SNEAKY && \
|
||||||
ua="$UA_SNEAKY" || \
|
ua="$UA_SNEAKY" || \
|
||||||
ua="$UA_STD"
|
ua="$UA_STD"
|
||||||
if [[ ! -z "$BASICAUTH" ]]; then
|
if [[ ! -z "$BASICAUTH" ]]; then
|
||||||
BASIC_AUTH_HEADER="Authorization: Basic `echo $BASICAUTH | basenc --base64` \r\n"
|
basicauth_header="Authorization: Basic $(echo $BASICAUTH | openssl base64) \r\n"
|
||||||
fi
|
fi
|
||||||
GET_REQ11="GET $URL_PATH HTTP/1.1\r\nHost: $NODE\r\nUser-Agent: $ua\r\n$BASIC_AUTH_HEADER Accept-Encoding: identity\r\nAccept: text/*\r\nConnection: Close\r\n\r\n"
|
GET_REQ11="GET $URL_PATH HTTP/1.1\r\nHost: $NODE\r\nUser-Agent: $ua\r\n$basicauth_header Accept-Encoding: identity\r\nAccept: text/*\r\nConnection: Close\r\n\r\n"
|
||||||
# returns always 0:
|
# returns always 0:
|
||||||
service_detection $OPTIMAL_PROTO
|
service_detection $OPTIMAL_PROTO
|
||||||
else # STARTTLS
|
else # STARTTLS
|
||||||
|
Loading…
Reference in New Issue
Block a user