hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sreyan Chakravarty <sreyan.mail...@gmail.com>
Subject Re: Proxy Connection fails with Apache HttpClient but succeeds with java.net.URLConnection
Date Fri, 03 Aug 2018 14:32:07 GMT
It worked. Thanks for the help. This example helped me :

https://hc.apache.org/httpcomponents-client-4.5.x/httpclient-win/examples/org/apache/http/examples/client/win/ClientWinAuth.java

On Wed, Jul 25, 2018 at 8:07 PM Sreyan Chakravarty <sreyan.mailing@gmail.com>
wrote:

> What is the difference between them? What is the meaning of  "Windows
> platform specific authentication code" ? What is the authentication
> code?  Also what is " native Windows authentication " ? Where can I find
> more information about this? Any docs?
>
> What is the meaning of authentication code?
>
> Could you please provide more info.
>
> On Wed, Jul 25, 2018 at 1:47 PM Oleg Kalnichevski <olegk@apache.org>
> wrote:
>
>> On Tue, 2018-07-24 at 20:50 +0530, Sreyan Chakravarty wrote:
>> > I am on a Windows machine at work and am using HttpClient to make a
>> > request
>> > via a web proxy. But the problem is that I keep 407 Authentication
>> > required
>> > message.
>> >
>> > But if I do the same thing via the RestTemplate of Spring, which uses
>> > the
>> > vanilla java.net.URLConnection class, with supplying just the proxy
>> > address
>> > and port, it works fine. *It doesn't even need the user name and
>> > password
>> > for authentication. *
>> >
>> > Why does this work? Why does HttpClient fail?
>> >
>> > Doing some digging into the source I made out that HttpClient first
>> > opens a
>> > socket to the required address and then reads and writes from that
>> > socket.
>> > AFAIK, java.net.URLConnection does not do that.
>> >
>> > So my question is what does java.net.URLConnection do differently?
>> > What is
>> > the difference between opening a socket.
>> >
>> > Also how do I make HttpClient behave like  java.net.URLConnection so
>> > that I
>> > can avoid the error.
>> >
>> > Clearly  java.net.URLConnection  is doing something right.
>> >
>>
>> Right or wrong, it uses Windows platform specific authentication code.
>> HttpClient supports native Windows authentication when running on
>> Windows family of OSes
>>
>> http://hc.apache.org/httpcomponents-client-4.5.x/httpclient-win/apidocs
>> /index.html
>> <http://hc.apache.org/httpcomponents-client-4.5.x/httpclient-win/apidocs/index.html>
>>
>> Oleg
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>
>>
>
> --
> Regards,
> Sreyan
>


-- 
Regards,
Sreyan

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message