From c94f30603009ce8d9913b4b99f2c456780617564 Mon Sep 17 00:00:00 2001 From: dubit0 Date: Wed, 10 May 2017 09:15:24 +0200 Subject: [PATCH] proxy support: update HTTP CONNECT to conform RFC2616 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When connecting to the proxy we should include the Host-header into the request. This is required by RFC2616 section 14.23 "A client MUST include a Host header field in all HTTP/1.1 request messages". While without this change some proxies reject connections, no such problems appear with this patch applied. Signed-off-by: Thomas Niederprüm --- testssl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testssl.sh b/testssl.sh index d98c585..de53937 100755 --- a/testssl.sh +++ b/testssl.sh @@ -6973,7 +6973,7 @@ fd_socket() { pr_magenta "$PROG_NAME: unable to open a socket to proxy $PROXYIP:$PROXYPORT" return 6 fi - echo "CONNECT $nodeip:$PORT" >&5 + echo -en "CONNECT $NODE:$PORT HTTP/1.1\r\nHost: $NODE:$PORT\r\n\r\n" >&5 while true ; do read proyxline <&5 if [[ "${proyxline%/*}" == "HTTP" ]]; then