JoeDog / siege

Siege is an http load tester and benchmarking utility
GNU General Public License v3.0
5.9k stars 386 forks source link

https_tunnel_request() does not handle proxy auth. #237

Open fraff opened 2 months ago

fraff commented 2 months ago

Environment:

 siege 4.0.7 and lastest

Output with https:

 CONNECT www.joedog.org:443 HTTP/1.0
 User-agent: Proxy-User

 HTTP/1.1 407 Proxy Authentication Required
 proxy-authenticate: BASIC realm="PROXY_INTERNET"
 cache-control: no-cache
 x-xss-protection: 1
 content-type: text/html; charset=utf-8
 content-length: 849
 pragma: no-cache
 connection: close

 [error] stack: A00010B : error:0A00010B:SSL routines::wrong version number
 [error] Failed to make an SSL connection: 5

 ...

Output with no ssl:

 HEAD http://www.joedog.org:80/siege-home/ HTTP/1.0
 Host: www.joedog.org
 Accept: */*
 Accept-Encoding: gzip, deflate
 User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0
 Connection: close

 HTTP/1.1 407 Proxy Authentication Required
 set-cookie: BCSI-CS-b203e9c56970692c=2; Path=/
 proxy-authenticate: BASIC realm="PROXY_INTERNET"
 cache-control: no-cache
 x-xss-protection: 1
 content-type: text/html; charset=utf-8
 content-length: 849
 pragma: no-cache
 connection: close

 HEAD http://www.joedog.org:80/siege-home/ HTTP/1.0
 Host: www.joedog.org
 Proxy-Authorization: Basic *******************=
 Cookie: BCSI-CS-b203e9c56970692c=2
 Accept: */*
 Accept-Encoding: gzip, deflate
 User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0
 Connection: close

I guess it should be implemented in src/http.c:L61

Note that user-agent is not handled correctly neither in https_tunnel_request()