On Fri, 2019-07-12 at 17:55 +0530, Kaushal Kothari wrote: > Hi Team, > > I am trying to do POC using the HttpClient 4.5.5 library and want to > access HTTPS url masked through a http proxy server with basic > authentication > and its failing. > > The authentication proxy header should be sent as part of the connect > but it is not happening. > > I have also added the header "Proxy-Authorization Basic > <encodedAuth>" to POST request as it requires and passing request > object to httpclient through execute() method. > > Apart from that preemptive authentication is also set. > > > > > But over the network, "Proxy-Authorization Basic <encodedAuth>" > header is missing. > > I tried same scenario to access the HTTP request everything works > fine. > > On the fly [No "Proxy-Authorization" header]: > > > REQUEST: > > CONNECT localhost:4080 HTTP/1.1 > Host: 127.0.0.1:9090 > User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_191) > > RESPONSE: > > "HTTP/1.1 407 Proxy Authentication Required > Server: Proxy > Proxy-Authenticate: Basic realm="**** Authorization" > Cache-control: no-cache > Connection: Close > Proxy-Connection: Close > Content-Length: 0" > > Could you please help me on this issue? and let me know if you > require any further information. > > -- > Thanks, > Kaushal.
Hi Kaushal I am not sure I understand what your expectations are. You are manually adding the Proxy-Authorization header to the wrong request message instead of using the standard authentication API and letting HttpClient generate the header for you. Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org