You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Oleg Kalnichevski <ol...@apache.org> on 2011/11/14 16:03:41 UTC

Re: JAVA Client on Windows 7 talking to ISS 6 with no HTTPs but Integrated Windows Authentication turned ON

On Mon, Nov 14, 2011 at 09:29:10AM -0500, Milind Kadam wrote:
> Hi There,
> 
> I am new to HTTPClient and trying to use it to implement JAVA Client which
> can talk to Web Server. I wan using URLConnect and everything was working
> fine against IIS 6 web server until disabled the anonymous access. So
> trying to use the HTTPClient. Example ClientInteractiveAuthentication.java
> works fine if I choose Basic authentication but when I set Integrated
> Windows authentication; authState.getAuthScheme returns null.
> 
> Any help is appreciated.
> 
> Thanks,
> Milind

Milind,

If you run your applications with the wire / context logging on as described here [1] you should get additional details about request execution process and might be able to see why HttpClient was unable to authenticate when Integrated Windows authentication is activated on the server side.

Oleg

[1] http://hc.apache.org/httpcomponents-client-ga/logging.html


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: JAVA Client on Windows 7 talking to ISS 6 with no HTTPs but Integrated Windows Authentication turned ON

Posted by sebb <se...@gmail.com>.
On 29 November 2011 15:40, Milind Kadam <ka...@gmail.com> wrote:
> Yes, because the browsers can access same URL; unless I am missing majorly
> something.

The browsers may be using an automatic proxy.

Try using an alternative utility such as curl or wget.


> --Milind
>
>
>
> On Tue, Nov 29, 2011 at 10:35 AM, sebb <se...@gmail.com> wrote:
>
>> On 29 November 2011 14:18, Milind Kadam <ka...@gmail.com> wrote:
>> > Hi Oleg,
>> >
>> > I could get the ClientAuthenticaiton working after I moved my web server
>> to
>> > different machine. But after setting this web server behind firewall; I
>> get
>> > "Connection timed out: connect".
>>
>> That should be a big clue.
>> It works without the firewall, and does not work with the firewall.
>>
>> So - have you set up the firewall to allow the connections?
>>
>> > Thanks in advance and any help appreciated.
>> >
>> > Here is the debug log:
>> >
>> > Trying:: 1
>> > executing request GET
>> https://mywebserver/cw_common/servlet/PMBuilderHTTP/1.1
>> > 2011/11/28 16:24:01:348 EST [DEBUG] PoolingClientConnectionManager -
>> > Connection request: [route: {s}->https://mywebserver][total kept alive:
>> > 0;route allocated: 0 of 2; total allocated: 0 of 20]
>> > 2011/11/28 16:24:01:348 EST [DEBUG] PoolingClientConnectionManager -
>> > Connection leased: [id: 0][route: {s}->https://mywebserver][total kept
>> > alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
>> > 2011/11/28 16:24:01:551 EST [DEBUG] DefaultClientConnectionOperator -
>> > Connecting to mywebserver:443
>> > 2011/11/28 16:24:22:535 EST [DEBUG] DefaultClientConnection - Connection
>> > org.apache.http.impl.conn.DefaultClientConnection@105bd58 closed
>> > 2011/11/28 16:24:22:535 EST [DEBUG] DefaultClientConnection - Connection
>> > org.apache.http.impl.conn.DefaultClientConnection@105bd58 shut down
>> > 2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
>> > Connection[id: 0][route: {s}->https://mywebserver] can be kept alive for
>> > 9223372036854775807 MILLISECONDS
>> > 2011/11/28 16:24:22:535 EST [DEBUG] DefaultClientConnection - Connection
>> > org.apache.http.impl.conn.DefaultClientConnection@105bd58 closed
>> > 2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
>> > Connection released: [id: 0][route: {s}->https://mywebserver][total kept
>> > alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
>> > 2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
>> > Connection manager is shutting down
>> > 2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
>> > Connection manager shut down
>> > Exception in thread "main" org.apache.http.conn.HttpHostConnectException:
>> > Connection to https://mywebserver refused
>> >        at
>> >
>> org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:190)
>> >        at
>> >
>> org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
>> >        at
>> >
>> org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:636)
>> >        at
>> >
>> org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:477)
>> >        at
>> >
>> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:923)
>> >        at
>> >
>> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:822)
>> >        at
>> >
>> clientauthentication.ClientAuthentication.main(ClientAuthentication.java:76)
>> >
>> > Caused by: java.net.ConnectException: Connection timed out: connect
>> >        at java.net.PlainSocketImpl.socketConnect(Native Method)
>> >        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>> >        at
>> > java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>> >        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>> >        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>> >        at java.net.Socket.connect(Socket.java:519)
>> >        at
>> >
>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:550)
>> >        at
>> >
>> org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:533)
>> >        at
>> >
>> org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
>> >
>> >
>> >
>> > --Milind
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > On Tue, Nov 15, 2011 at 10:03 AM, Oleg Kalnichevski <olegk@apache.org
>> >wrote:
>> >
>> >> On Tue, Nov 15, 2011 at 09:59:33AM -0500, Milind Kadam wrote:
>> >> > Yeah, I have seen that but then the question is why the URL works when
>> >> > executed from both IE and FireFox browsers?
>> >> >
>> >> > --Milind
>> >> >
>> >>
>> >> Because both applications can (and as far as I know actually do) use
>> >> Windows platform specific APIs, which HttpClient being a pure Java
>> library
>> >> is not able to make use of.
>> >>
>> >> Oleg
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>> >> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>> >>
>> >>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: JAVA Client on Windows 7 talking to ISS 6 with no HTTPs but Integrated Windows Authentication turned ON

Posted by sebb <se...@gmail.com>.
On 29 November 2011 15:42, Milind Kadam <ka...@gmail.com> wrote:
> Another clue is we cannot ping the web server from client; does this help?

Not really, as ping uses a different protocol and ports.

The firewall may not be set up to allow pings.

> --Milind
>
>
>
> On Tue, Nov 29, 2011 at 10:40 AM, Milind Kadam <ka...@gmail.com>wrote:
>
>>
>> Yes, because the browsers can access same URL; unless I am missing majorly
>> something.
>>
>> --Milind
>>
>>
>>
>> On Tue, Nov 29, 2011 at 10:35 AM, sebb <se...@gmail.com> wrote:
>>
>>> On 29 November 2011 14:18, Milind Kadam <ka...@gmail.com> wrote:
>>> > Hi Oleg,
>>> >
>>> > I could get the ClientAuthenticaiton working after I moved my web
>>> server to
>>> > different machine. But after setting this web server behind firewall; I
>>> get
>>> > "Connection timed out: connect".
>>>
>>> That should be a big clue.
>>> It works without the firewall, and does not work with the firewall.
>>>
>>> So - have you set up the firewall to allow the connections?
>>>
>>> > Thanks in advance and any help appreciated.
>>> >
>>> > Here is the debug log:
>>> >
>>> > Trying:: 1
>>> > executing request GET
>>> https://mywebserver/cw_common/servlet/PMBuilderHTTP/1.1
>>> > 2011/11/28 16:24:01:348 EST [DEBUG] PoolingClientConnectionManager -
>>> > Connection request: [route: {s}->https://mywebserver][total kept alive:
>>> > 0;route allocated: 0 of 2; total allocated: 0 of 20]
>>> > 2011/11/28 16:24:01:348 EST [DEBUG] PoolingClientConnectionManager -
>>> > Connection leased: [id: 0][route: {s}->https://mywebserver][total kept
>>> > alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
>>> > 2011/11/28 16:24:01:551 EST [DEBUG] DefaultClientConnectionOperator -
>>> > Connecting to mywebserver:443
>>> > 2011/11/28 16:24:22:535 EST [DEBUG] DefaultClientConnection - Connection
>>> > org.apache.http.impl.conn.DefaultClientConnection@105bd58 closed
>>> > 2011/11/28 16:24:22:535 EST [DEBUG] DefaultClientConnection - Connection
>>> > org.apache.http.impl.conn.DefaultClientConnection@105bd58 shut down
>>> > 2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
>>> > Connection[id: 0][route: {s}->https://mywebserver] can be kept alive
>>> for
>>> > 9223372036854775807 MILLISECONDS
>>> > 2011/11/28 16:24:22:535 EST [DEBUG] DefaultClientConnection - Connection
>>> > org.apache.http.impl.conn.DefaultClientConnection@105bd58 closed
>>> > 2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
>>> > Connection released: [id: 0][route: {s}->https://mywebserver][total
>>> kept
>>> > alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
>>> > 2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
>>> > Connection manager is shutting down
>>> > 2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
>>> > Connection manager shut down
>>> > Exception in thread "main"
>>> org.apache.http.conn.HttpHostConnectException:
>>> > Connection to https://mywebserver refused
>>> >        at
>>> >
>>> org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:190)
>>> >        at
>>> >
>>> org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
>>> >        at
>>> >
>>> org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:636)
>>> >        at
>>> >
>>> org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:477)
>>> >        at
>>> >
>>> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:923)
>>> >        at
>>> >
>>> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:822)
>>> >        at
>>> >
>>> clientauthentication.ClientAuthentication.main(ClientAuthentication.java:76)
>>> >
>>> > Caused by: java.net.ConnectException: Connection timed out: connect
>>> >        at java.net.PlainSocketImpl.socketConnect(Native Method)
>>> >        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>>> >        at
>>> > java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>>> >        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>>> >        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>>> >        at java.net.Socket.connect(Socket.java:519)
>>> >        at
>>> >
>>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:550)
>>> >        at
>>> >
>>> org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:533)
>>> >        at
>>> >
>>> org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
>>> >
>>> >
>>> >
>>> > --Milind
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > On Tue, Nov 15, 2011 at 10:03 AM, Oleg Kalnichevski <olegk@apache.org
>>> >wrote:
>>> >
>>> >> On Tue, Nov 15, 2011 at 09:59:33AM -0500, Milind Kadam wrote:
>>> >> > Yeah, I have seen that but then the question is why the URL works
>>> when
>>> >> > executed from both IE and FireFox browsers?
>>> >> >
>>> >> > --Milind
>>> >> >
>>> >>
>>> >> Because both applications can (and as far as I know actually do) use
>>> >> Windows platform specific APIs, which HttpClient being a pure Java
>>> library
>>> >> is not able to make use of.
>>> >>
>>> >> Oleg
>>> >>
>>> >>
>>> >> ---------------------------------------------------------------------
>>> >> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>>> >> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>> >>
>>> >>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>>
>>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: JAVA Client on Windows 7 talking to ISS 6 with no HTTPs but Integrated Windows Authentication turned ON

Posted by Milind Kadam <ka...@gmail.com>.
Another clue is we cannot ping the web server from client; does this help?

--Milind



On Tue, Nov 29, 2011 at 10:40 AM, Milind Kadam <ka...@gmail.com>wrote:

>
> Yes, because the browsers can access same URL; unless I am missing majorly
> something.
>
> --Milind
>
>
>
> On Tue, Nov 29, 2011 at 10:35 AM, sebb <se...@gmail.com> wrote:
>
>> On 29 November 2011 14:18, Milind Kadam <ka...@gmail.com> wrote:
>> > Hi Oleg,
>> >
>> > I could get the ClientAuthenticaiton working after I moved my web
>> server to
>> > different machine. But after setting this web server behind firewall; I
>> get
>> > "Connection timed out: connect".
>>
>> That should be a big clue.
>> It works without the firewall, and does not work with the firewall.
>>
>> So - have you set up the firewall to allow the connections?
>>
>> > Thanks in advance and any help appreciated.
>> >
>> > Here is the debug log:
>> >
>> > Trying:: 1
>> > executing request GET
>> https://mywebserver/cw_common/servlet/PMBuilderHTTP/1.1
>> > 2011/11/28 16:24:01:348 EST [DEBUG] PoolingClientConnectionManager -
>> > Connection request: [route: {s}->https://mywebserver][total kept alive:
>> > 0;route allocated: 0 of 2; total allocated: 0 of 20]
>> > 2011/11/28 16:24:01:348 EST [DEBUG] PoolingClientConnectionManager -
>> > Connection leased: [id: 0][route: {s}->https://mywebserver][total kept
>> > alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
>> > 2011/11/28 16:24:01:551 EST [DEBUG] DefaultClientConnectionOperator -
>> > Connecting to mywebserver:443
>> > 2011/11/28 16:24:22:535 EST [DEBUG] DefaultClientConnection - Connection
>> > org.apache.http.impl.conn.DefaultClientConnection@105bd58 closed
>> > 2011/11/28 16:24:22:535 EST [DEBUG] DefaultClientConnection - Connection
>> > org.apache.http.impl.conn.DefaultClientConnection@105bd58 shut down
>> > 2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
>> > Connection[id: 0][route: {s}->https://mywebserver] can be kept alive
>> for
>> > 9223372036854775807 MILLISECONDS
>> > 2011/11/28 16:24:22:535 EST [DEBUG] DefaultClientConnection - Connection
>> > org.apache.http.impl.conn.DefaultClientConnection@105bd58 closed
>> > 2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
>> > Connection released: [id: 0][route: {s}->https://mywebserver][total
>> kept
>> > alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
>> > 2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
>> > Connection manager is shutting down
>> > 2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
>> > Connection manager shut down
>> > Exception in thread "main"
>> org.apache.http.conn.HttpHostConnectException:
>> > Connection to https://mywebserver refused
>> >        at
>> >
>> org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:190)
>> >        at
>> >
>> org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
>> >        at
>> >
>> org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:636)
>> >        at
>> >
>> org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:477)
>> >        at
>> >
>> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:923)
>> >        at
>> >
>> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:822)
>> >        at
>> >
>> clientauthentication.ClientAuthentication.main(ClientAuthentication.java:76)
>> >
>> > Caused by: java.net.ConnectException: Connection timed out: connect
>> >        at java.net.PlainSocketImpl.socketConnect(Native Method)
>> >        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>> >        at
>> > java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>> >        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>> >        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>> >        at java.net.Socket.connect(Socket.java:519)
>> >        at
>> >
>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:550)
>> >        at
>> >
>> org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:533)
>> >        at
>> >
>> org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
>> >
>> >
>> >
>> > --Milind
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > On Tue, Nov 15, 2011 at 10:03 AM, Oleg Kalnichevski <olegk@apache.org
>> >wrote:
>> >
>> >> On Tue, Nov 15, 2011 at 09:59:33AM -0500, Milind Kadam wrote:
>> >> > Yeah, I have seen that but then the question is why the URL works
>> when
>> >> > executed from both IE and FireFox browsers?
>> >> >
>> >> > --Milind
>> >> >
>> >>
>> >> Because both applications can (and as far as I know actually do) use
>> >> Windows platform specific APIs, which HttpClient being a pure Java
>> library
>> >> is not able to make use of.
>> >>
>> >> Oleg
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>> >> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>> >>
>> >>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>
>>
>

Re: JAVA Client on Windows 7 talking to ISS 6 with no HTTPs but Integrated Windows Authentication turned ON

Posted by Milind Kadam <ka...@gmail.com>.
Yes, because the browsers can access same URL; unless I am missing majorly
something.

--Milind



On Tue, Nov 29, 2011 at 10:35 AM, sebb <se...@gmail.com> wrote:

> On 29 November 2011 14:18, Milind Kadam <ka...@gmail.com> wrote:
> > Hi Oleg,
> >
> > I could get the ClientAuthenticaiton working after I moved my web server
> to
> > different machine. But after setting this web server behind firewall; I
> get
> > "Connection timed out: connect".
>
> That should be a big clue.
> It works without the firewall, and does not work with the firewall.
>
> So - have you set up the firewall to allow the connections?
>
> > Thanks in advance and any help appreciated.
> >
> > Here is the debug log:
> >
> > Trying:: 1
> > executing request GET
> https://mywebserver/cw_common/servlet/PMBuilderHTTP/1.1
> > 2011/11/28 16:24:01:348 EST [DEBUG] PoolingClientConnectionManager -
> > Connection request: [route: {s}->https://mywebserver][total kept alive:
> > 0;route allocated: 0 of 2; total allocated: 0 of 20]
> > 2011/11/28 16:24:01:348 EST [DEBUG] PoolingClientConnectionManager -
> > Connection leased: [id: 0][route: {s}->https://mywebserver][total kept
> > alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
> > 2011/11/28 16:24:01:551 EST [DEBUG] DefaultClientConnectionOperator -
> > Connecting to mywebserver:443
> > 2011/11/28 16:24:22:535 EST [DEBUG] DefaultClientConnection - Connection
> > org.apache.http.impl.conn.DefaultClientConnection@105bd58 closed
> > 2011/11/28 16:24:22:535 EST [DEBUG] DefaultClientConnection - Connection
> > org.apache.http.impl.conn.DefaultClientConnection@105bd58 shut down
> > 2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
> > Connection[id: 0][route: {s}->https://mywebserver] can be kept alive for
> > 9223372036854775807 MILLISECONDS
> > 2011/11/28 16:24:22:535 EST [DEBUG] DefaultClientConnection - Connection
> > org.apache.http.impl.conn.DefaultClientConnection@105bd58 closed
> > 2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
> > Connection released: [id: 0][route: {s}->https://mywebserver][total kept
> > alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
> > 2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
> > Connection manager is shutting down
> > 2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
> > Connection manager shut down
> > Exception in thread "main" org.apache.http.conn.HttpHostConnectException:
> > Connection to https://mywebserver refused
> >        at
> >
> org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:190)
> >        at
> >
> org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
> >        at
> >
> org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:636)
> >        at
> >
> org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:477)
> >        at
> >
> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:923)
> >        at
> >
> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:822)
> >        at
> >
> clientauthentication.ClientAuthentication.main(ClientAuthentication.java:76)
> >
> > Caused by: java.net.ConnectException: Connection timed out: connect
> >        at java.net.PlainSocketImpl.socketConnect(Native Method)
> >        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> >        at
> > java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> >        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> >        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> >        at java.net.Socket.connect(Socket.java:519)
> >        at
> >
> com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:550)
> >        at
> >
> org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:533)
> >        at
> >
> org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
> >
> >
> >
> > --Milind
> >
> >
> >
> >
> >
> >
> >
> >
> > On Tue, Nov 15, 2011 at 10:03 AM, Oleg Kalnichevski <olegk@apache.org
> >wrote:
> >
> >> On Tue, Nov 15, 2011 at 09:59:33AM -0500, Milind Kadam wrote:
> >> > Yeah, I have seen that but then the question is why the URL works when
> >> > executed from both IE and FireFox browsers?
> >> >
> >> > --Milind
> >> >
> >>
> >> Because both applications can (and as far as I know actually do) use
> >> Windows platform specific APIs, which HttpClient being a pure Java
> library
> >> is not able to make use of.
> >>
> >> Oleg
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> >> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

Re: JAVA Client on Windows 7 talking to ISS 6 with no HTTPs but Integrated Windows Authentication turned ON

Posted by sebb <se...@gmail.com>.
On 29 November 2011 14:18, Milind Kadam <ka...@gmail.com> wrote:
> Hi Oleg,
>
> I could get the ClientAuthenticaiton working after I moved my web server to
> different machine. But after setting this web server behind firewall; I get
> "Connection timed out: connect".

That should be a big clue.
It works without the firewall, and does not work with the firewall.

So - have you set up the firewall to allow the connections?

> Thanks in advance and any help appreciated.
>
> Here is the debug log:
>
> Trying:: 1
> executing request GET https://mywebserver/cw_common/servlet/PMBuilderHTTP/1.1
> 2011/11/28 16:24:01:348 EST [DEBUG] PoolingClientConnectionManager -
> Connection request: [route: {s}->https://mywebserver][total kept alive:
> 0;route allocated: 0 of 2; total allocated: 0 of 20]
> 2011/11/28 16:24:01:348 EST [DEBUG] PoolingClientConnectionManager -
> Connection leased: [id: 0][route: {s}->https://mywebserver][total kept
> alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
> 2011/11/28 16:24:01:551 EST [DEBUG] DefaultClientConnectionOperator -
> Connecting to mywebserver:443
> 2011/11/28 16:24:22:535 EST [DEBUG] DefaultClientConnection - Connection
> org.apache.http.impl.conn.DefaultClientConnection@105bd58 closed
> 2011/11/28 16:24:22:535 EST [DEBUG] DefaultClientConnection - Connection
> org.apache.http.impl.conn.DefaultClientConnection@105bd58 shut down
> 2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
> Connection[id: 0][route: {s}->https://mywebserver] can be kept alive for
> 9223372036854775807 MILLISECONDS
> 2011/11/28 16:24:22:535 EST [DEBUG] DefaultClientConnection - Connection
> org.apache.http.impl.conn.DefaultClientConnection@105bd58 closed
> 2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
> Connection released: [id: 0][route: {s}->https://mywebserver][total kept
> alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
> 2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
> Connection manager is shutting down
> 2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
> Connection manager shut down
> Exception in thread "main" org.apache.http.conn.HttpHostConnectException:
> Connection to https://mywebserver refused
>        at
> org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:190)
>        at
> org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
>        at
> org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:636)
>        at
> org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:477)
>        at
> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:923)
>        at
> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:822)
>        at
> clientauthentication.ClientAuthentication.main(ClientAuthentication.java:76)
>
> Caused by: java.net.ConnectException: Connection timed out: connect
>        at java.net.PlainSocketImpl.socketConnect(Native Method)
>        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>        at
> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>        at java.net.Socket.connect(Socket.java:519)
>        at
> com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:550)
>        at
> org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:533)
>        at
> org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
>
>
>
> --Milind
>
>
>
>
>
>
>
>
> On Tue, Nov 15, 2011 at 10:03 AM, Oleg Kalnichevski <ol...@apache.org>wrote:
>
>> On Tue, Nov 15, 2011 at 09:59:33AM -0500, Milind Kadam wrote:
>> > Yeah, I have seen that but then the question is why the URL works when
>> > executed from both IE and FireFox browsers?
>> >
>> > --Milind
>> >
>>
>> Because both applications can (and as far as I know actually do) use
>> Windows platform specific APIs, which HttpClient being a pure Java library
>> is not able to make use of.
>>
>> Oleg
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: JAVA Client on Windows 7 talking to ISS 6 with no HTTPs but Integrated Windows Authentication turned ON

Posted by Milind Kadam <ka...@gmail.com>.
Hi Oleg,

I could get the ClientAuthenticaiton working after I moved my web server to
different machine. But after setting this web server behind firewall; I get
"Connection timed out: connect".

Thanks in advance and any help appreciated.

Here is the debug log:

Trying:: 1
executing request GET https://mywebserver/cw_common/servlet/PMBuilderHTTP/1.1
2011/11/28 16:24:01:348 EST [DEBUG] PoolingClientConnectionManager -
Connection request: [route: {s}->https://mywebserver][total kept alive:
0;route allocated: 0 of 2; total allocated: 0 of 20]
2011/11/28 16:24:01:348 EST [DEBUG] PoolingClientConnectionManager -
Connection leased: [id: 0][route: {s}->https://mywebserver][total kept
alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
2011/11/28 16:24:01:551 EST [DEBUG] DefaultClientConnectionOperator -
Connecting to mywebserver:443
2011/11/28 16:24:22:535 EST [DEBUG] DefaultClientConnection - Connection
org.apache.http.impl.conn.DefaultClientConnection@105bd58 closed
2011/11/28 16:24:22:535 EST [DEBUG] DefaultClientConnection - Connection
org.apache.http.impl.conn.DefaultClientConnection@105bd58 shut down
2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
Connection[id: 0][route: {s}->https://mywebserver] can be kept alive for
9223372036854775807 MILLISECONDS
2011/11/28 16:24:22:535 EST [DEBUG] DefaultClientConnection - Connection
org.apache.http.impl.conn.DefaultClientConnection@105bd58 closed
2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
Connection released: [id: 0][route: {s}->https://mywebserver][total kept
alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
Connection manager is shutting down
2011/11/28 16:24:22:535 EST [DEBUG] PoolingClientConnectionManager -
Connection manager shut down
Exception in thread "main" org.apache.http.conn.HttpHostConnectException:
Connection to https://mywebserver refused
        at
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:190)
        at
org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
        at
org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:636)
        at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:477)
        at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:923)
        at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:822)
        at
clientauthentication.ClientAuthentication.main(ClientAuthentication.java:76)

Caused by: java.net.ConnectException: Connection timed out: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:519)
        at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:550)
        at
org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:533)
        at
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)



--Milind








On Tue, Nov 15, 2011 at 10:03 AM, Oleg Kalnichevski <ol...@apache.org>wrote:

> On Tue, Nov 15, 2011 at 09:59:33AM -0500, Milind Kadam wrote:
> > Yeah, I have seen that but then the question is why the URL works when
> > executed from both IE and FireFox browsers?
> >
> > --Milind
> >
>
> Because both applications can (and as far as I know actually do) use
> Windows platform specific APIs, which HttpClient being a pure Java library
> is not able to make use of.
>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

Re: JAVA Client on Windows 7 talking to ISS 6 with no HTTPs but Integrated Windows Authentication turned ON

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, Nov 15, 2011 at 09:59:33AM -0500, Milind Kadam wrote:
> Yeah, I have seen that but then the question is why the URL works when
> executed from both IE and FireFox browsers?
> 
> --Milind
> 

Because both applications can (and as far as I know actually do) use Windows platform specific APIs, which HttpClient being a pure Java library is not able to make use of.

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: JAVA Client on Windows 7 talking to ISS 6 with no HTTPs but Integrated Windows Authentication turned ON

Posted by Milind Kadam <ka...@gmail.com>.
Yeah, I have seen that but then the question is why the URL works when
executed from both IE and FireFox browsers?

--Milind



On Tue, Nov 15, 2011 at 9:55 AM, Oleg Kalnichevski <ol...@apache.org> wrote:

> On Tue, Nov 15, 2011 at 09:47:13AM -0500, Milind Kadam wrote:
> > Thanks again. I tried NTCredentials too and still failed to connect.
> >
> >                         // Set credentials on the client
> >                         Credentials credentials = new NTCredentials(
> user,
> > password, host, domain );
> >
> > httpclient.getCredentialsProvider().setCredentials(new
> AuthScope(authhost),
> > credentials);
> >
> >
>
> ...
>
> > 2011/11/15 09:32:52:130 EST [DEBUG] headers - >> GET
> > /cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
> > 2011/11/15 09:32:52:130 EST [DEBUG] headers - >> Host: wkqasv0304
> > 2011/11/15 09:32:52:130 EST [DEBUG] headers - >> Connection: Keep-Alive
> > 2011/11/15 09:32:52:130 EST [DEBUG] headers - >> User-Agent:
> > Apache-HttpClient/4.2-alpha1 (java 1.5)
> > 2011/11/15 09:32:52:130 EST [DEBUG] headers - >> Authorization: NTLM
> >
> TlRMTVNTUAADAAAAGAAYAEAAAADGAMYAWAAAAAwADAAeAQAAGgAaACoBAAAUABQARAEAAAAAAABYAQAANQIIILSQ0oov0UPrrEPz9qPc3yv+kmCyOZd7DQvlcbZj8y0jhZwR7wjytMsBAQAAAAAAACAYynSjo8wB/pJgsjmXew0AAAAAAgAMAEcATABPAEIAQQBMAAEAFABXAEsAUQBBAFMAVgAwADMAMAA0AAQAHgBnAGwAbwBiAGEAbAAuAHMAZABsAC4AYwBvAHIAcAADADQAdwBrAHEAYQBzAHYAMAAzADAANAAuAGcAbABvAGIAYQBsAC4AcwBkAGwALgBjAG8AcgBwAAUAEABzAGQAbAAuAGMAbwByAHAAAAAAAEcATABPAEIAQQBMAGEAZABtAGkAbgBpAHMAdAByAGEAdABvAHIAVwBLAFEAQQBTAFYAMAAzADAANAA=
> > 2011/11/15 09:32:52:255 EST [DEBUG] DefaultClientConnection - Receiving
> > response: HTTP/1.1 500 Internal Server Error
> > 2011/11/15 09:32:52:255 EST [DEBUG] headers - << HTTP/1.1 500 Internal
> > Server Error
>
> There was an error on the server side. If you are a paying Microsoft
> customer you may want to try contacting their customer support.
>
> Oleg
>
>
>
> > 2011/11/15 09:32:52:255 EST [DEBUG] headers - << Content-Length: 112
> > 2011/11/15 09:32:52:255 EST [DEBUG] headers - << Content-Type: text/html
> > 2011/11/15 09:32:52:255 EST [DEBUG] headers - << Server:
> Microsoft-IIS/6.0
> > 2011/11/15 09:32:52:255 EST [DEBUG] headers - << Date: Tue, 15 Nov 2011
> > 14:32:51 GMT
> > 2011/11/15 09:32:52:255 EST [DEBUG] headers - << Connection: close
> > ----------------------------------------
> > HTTP/1.1 500 Internal Server Error
> > 2011/11/15 09:32:52:255 EST [DEBUG] PoolingClientConnectionManager -
> > Connection [id: 0][route: {}->http://wkqasv0304][state:
> > GLOBAL/administrator] can be kept alive indefinitely
> > 2011/11/15 09:32:52:255 EST [DEBUG] PoolingClientConnectionManager -
> > Connection released: [id: 0][route: {}->http://wkqasv0304][state:
> > GLOBAL/administrator][total kept alive: 1; route allocated: 1 of 2; total
> > allocated: 1 of 20]
> > 2011/11/15 09:32:52:255 EST [DEBUG] PoolingClientConnectionManager -
> > Connection manager is shutting down
> > 2011/11/15 09:32:52:255 EST [DEBUG] DefaultClientConnection - Connection
> > 0.0.0.0:55123<->10.102.11.40:80 closed
> > 2011/11/15 09:32:52:255 EST [DEBUG] DefaultClientConnection - Connection
> > 0.0.0.0:55123<->10.102.11.40:80 closed
> > 2011/11/15 09:32:52:255 EST [DEBUG] PoolingClientConnectionManager -
> > Connection manager shut down
> >
> >
> >
> >
> >
> >
> >
> >
> > On Tue, Nov 15, 2011 at 3:51 AM, Oleg Kalnichevski <ol...@apache.org>
> wrote:
> >
> > > On Mon, Nov 14, 2011 at 11:51:36AM -0500, Milind Kadam wrote:
> > > > Hi Oleg,
> > > >
> > > > I commented the line which use "AuthScheme" to print the Realm to
> console
> > > > and generated the output. Don't know whether this will help or not;
> but
> > > > with correct username/password; it fails to connect to IIS 6 web
> server
> > > > when "Integrated Windows authentication" is set.
> > > > Thanks,
> > > > Milind
> > > >
> > > >
> > >
> > > ...
> > >
> > > > 2011/11/14 11:43:16:322 EST [DEBUG] RequestTargetAuthentication -
> > > > Generating response to an authentication challenge using ntlm scheme
> > > > 2011/11/14 11:43:16:322 EST [WARN] RequestTargetAuthentication - NTLM
> > > > authentication error: Credentials cannot be used for NTLM
> authentication:
> > > > org.apache.http.auth.UsernamePasswordCredentials
> > >
> > > You are using UsernamePasswordCredentials that are not sufficient for
> NTLM
> > > authentication. You should be using NTCrednetials instead.
> > >
> > > Oleg
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > > For additional commands, e-mail: httpclient-users-help@hc.apache.org
> > >
> > >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

Re: JAVA Client on Windows 7 talking to ISS 6 with no HTTPs but Integrated Windows Authentication turned ON

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, Nov 15, 2011 at 09:47:13AM -0500, Milind Kadam wrote:
> Thanks again. I tried NTCredentials too and still failed to connect.
> 
>                         // Set credentials on the client
>                         Credentials credentials = new NTCredentials( user,
> password, host, domain );
> 
> httpclient.getCredentialsProvider().setCredentials(new AuthScope(authhost),
> credentials);
> 
>

...

> 2011/11/15 09:32:52:130 EST [DEBUG] headers - >> GET
> /cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
> 2011/11/15 09:32:52:130 EST [DEBUG] headers - >> Host: wkqasv0304
> 2011/11/15 09:32:52:130 EST [DEBUG] headers - >> Connection: Keep-Alive
> 2011/11/15 09:32:52:130 EST [DEBUG] headers - >> User-Agent:
> Apache-HttpClient/4.2-alpha1 (java 1.5)
> 2011/11/15 09:32:52:130 EST [DEBUG] headers - >> Authorization: NTLM
> TlRMTVNTUAADAAAAGAAYAEAAAADGAMYAWAAAAAwADAAeAQAAGgAaACoBAAAUABQARAEAAAAAAABYAQAANQIIILSQ0oov0UPrrEPz9qPc3yv+kmCyOZd7DQvlcbZj8y0jhZwR7wjytMsBAQAAAAAAACAYynSjo8wB/pJgsjmXew0AAAAAAgAMAEcATABPAEIAQQBMAAEAFABXAEsAUQBBAFMAVgAwADMAMAA0AAQAHgBnAGwAbwBiAGEAbAAuAHMAZABsAC4AYwBvAHIAcAADADQAdwBrAHEAYQBzAHYAMAAzADAANAAuAGcAbABvAGIAYQBsAC4AcwBkAGwALgBjAG8AcgBwAAUAEABzAGQAbAAuAGMAbwByAHAAAAAAAEcATABPAEIAQQBMAGEAZABtAGkAbgBpAHMAdAByAGEAdABvAHIAVwBLAFEAQQBTAFYAMAAzADAANAA=
> 2011/11/15 09:32:52:255 EST [DEBUG] DefaultClientConnection - Receiving
> response: HTTP/1.1 500 Internal Server Error
> 2011/11/15 09:32:52:255 EST [DEBUG] headers - << HTTP/1.1 500 Internal
> Server Error

There was an error on the server side. If you are a paying Microsoft customer you may want to try contacting their customer support.

Oleg



> 2011/11/15 09:32:52:255 EST [DEBUG] headers - << Content-Length: 112
> 2011/11/15 09:32:52:255 EST [DEBUG] headers - << Content-Type: text/html
> 2011/11/15 09:32:52:255 EST [DEBUG] headers - << Server: Microsoft-IIS/6.0
> 2011/11/15 09:32:52:255 EST [DEBUG] headers - << Date: Tue, 15 Nov 2011
> 14:32:51 GMT
> 2011/11/15 09:32:52:255 EST [DEBUG] headers - << Connection: close
> ----------------------------------------
> HTTP/1.1 500 Internal Server Error
> 2011/11/15 09:32:52:255 EST [DEBUG] PoolingClientConnectionManager -
> Connection [id: 0][route: {}->http://wkqasv0304][state:
> GLOBAL/administrator] can be kept alive indefinitely
> 2011/11/15 09:32:52:255 EST [DEBUG] PoolingClientConnectionManager -
> Connection released: [id: 0][route: {}->http://wkqasv0304][state:
> GLOBAL/administrator][total kept alive: 1; route allocated: 1 of 2; total
> allocated: 1 of 20]
> 2011/11/15 09:32:52:255 EST [DEBUG] PoolingClientConnectionManager -
> Connection manager is shutting down
> 2011/11/15 09:32:52:255 EST [DEBUG] DefaultClientConnection - Connection
> 0.0.0.0:55123<->10.102.11.40:80 closed
> 2011/11/15 09:32:52:255 EST [DEBUG] DefaultClientConnection - Connection
> 0.0.0.0:55123<->10.102.11.40:80 closed
> 2011/11/15 09:32:52:255 EST [DEBUG] PoolingClientConnectionManager -
> Connection manager shut down
> 
> 
> 
> 
> 
> 
> 
> 
> On Tue, Nov 15, 2011 at 3:51 AM, Oleg Kalnichevski <ol...@apache.org> wrote:
> 
> > On Mon, Nov 14, 2011 at 11:51:36AM -0500, Milind Kadam wrote:
> > > Hi Oleg,
> > >
> > > I commented the line which use "AuthScheme" to print the Realm to console
> > > and generated the output. Don't know whether this will help or not; but
> > > with correct username/password; it fails to connect to IIS 6 web server
> > > when "Integrated Windows authentication" is set.
> > > Thanks,
> > > Milind
> > >
> > >
> >
> > ...
> >
> > > 2011/11/14 11:43:16:322 EST [DEBUG] RequestTargetAuthentication -
> > > Generating response to an authentication challenge using ntlm scheme
> > > 2011/11/14 11:43:16:322 EST [WARN] RequestTargetAuthentication - NTLM
> > > authentication error: Credentials cannot be used for NTLM authentication:
> > > org.apache.http.auth.UsernamePasswordCredentials
> >
> > You are using UsernamePasswordCredentials that are not sufficient for NTLM
> > authentication. You should be using NTCrednetials instead.
> >
> > Oleg
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > For additional commands, e-mail: httpclient-users-help@hc.apache.org
> >
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: JAVA Client on Windows 7 talking to ISS 6 with no HTTPs but Integrated Windows Authentication turned ON

Posted by Milind Kadam <ka...@gmail.com>.
Thanks again. I tried NTCredentials too and still failed to connect.

                        // Set credentials on the client
                        Credentials credentials = new NTCredentials( user,
password, host, domain );

httpclient.getCredentialsProvider().setCredentials(new AuthScope(authhost),
credentials);

Below is the wired log. In FireFox where the URL works fine  (and IE too);
the FireBug output shows:

*Response Headers:*

*Date:*  Tue, 15 Nov 2011 14:28:45 GMT
*Server:*  Microsoft-IIS/6.0
*Cache-Control:*  no-cache
*Content-Type:*  text/xml;charset=UTF-8
*Content-Length:*  7

*Request Headers:*
**
*Host:*   wkqasv0304
*User-Agent:*  Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20100101
Firefox/6.0.2
*Accept:*  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
*Accept-Language:*  en-us,en;q=0.5
*Accept-Encoding:*  gzip, deflate
*Accept-Charset:*  ISO-8859-1,utf-8;q=0.7,*;q=0.7
*Connection:*  keep-alive
*Cookie:*  cw_loginOption=advanced; cw_socket=6050; cw_user=sysadmin;
cw_database=cetest; cw_portalNode=10.102.2.19
*Authorization:*  NTLM
TlRMTVNTUAADAAAAGAAYAIYAAAA0ATQBngAAAAAAAABYAAAAGgAaAFgAAAAUABQAcgAAAAAAAADSAQAABYKIogYBsR0AAAAPEvzMLqhfab0DHVZD20uvomEAZABtAGkAbgBpAHMAdAByAGEAdABvAHIAVwBLAEUATgBNAEsAQQBEAEEATQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC5uB7m9kF8rrdJn0LvXH9YAQEAAAAAAADhePDhoqPMARwKhNVfQviNAAAAAAIADABHAEwATwBCAEEATAABABQAVwBLAFEAQQBTAFYAMAAzADAANAAEAB4AZwBsAG8AYgBhAGwALgBzAGQAbAAuAGMAbwByAHAAAwA0AHcAawBxAGEAcwB2ADAAMwAwADQALgBnAGwAbwBiAGEAbAAuAHMAZABsAC4AYwBvAHIAcAAFABAAcwBkAGwALgBjAG8AcgBwAAgAMAAwAAAAAAAAAAAAAAAAMAAAaxAzfB10hnRHun/6nwKTJL4uExMsefwOJVkaWV9VsRQKABAAAAAAAAAAAAAAAAAAAAAAAAkAHgBIAFQAVABQAC8AdwBrAHEAYQBzAHYAMAAzADAANAAAAAAAAAAAAA==


*The wire log:*

Trying:: 1
executing request GET
http://wkqasv0304/cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/15 09:32:52:037 EST [DEBUG] PoolingClientConnectionManager -
Connection request: [route: {}->http://wkqasv0304][total kept alive: 0;
route allocated: 0 of 2; total allocated: 0 of 20]
2011/11/15 09:32:52:037 EST [DEBUG] PoolingClientConnectionManager -
Connection leased: [id: 0][route: {}->http://wkqasv0304][total kept alive:
0; route allocated: 1 of 2; total allocated: 1 of 20]
2011/11/15 09:32:52:037 EST [DEBUG] DefaultClientConnectionOperator -
Connecting to wkqasv0304:80
2011/11/15 09:32:52:052 EST [DEBUG] RequestAddCookies - CookieSpec
selected: best-match
2011/11/15 09:32:52:052 EST [DEBUG] RequestAuthCache - Auth cache not set
in the context
2011/11/15 09:32:52:052 EST [DEBUG] RequestTargetAuthentication - Target
auth state: UNCHALLENGED
2011/11/15 09:32:52:052 EST [DEBUG] RequestProxyAuthentication - Proxy auth
state: UNCHALLENGED
2011/11/15 09:32:52:052 EST [DEBUG] DefaultHttpClient - Attempt 1 to
execute request
2011/11/15 09:32:52:052 EST [DEBUG] DefaultClientConnection - Sending
request: GET /cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/15 09:32:52:052 EST [DEBUG] headers - >> GET
/cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/15 09:32:52:052 EST [DEBUG] headers - >> Host: wkqasv0304
2011/11/15 09:32:52:052 EST [DEBUG] headers - >> Connection: Keep-Alive
2011/11/15 09:32:52:052 EST [DEBUG] headers - >> User-Agent:
Apache-HttpClient/4.2-alpha1 (java 1.5)
2011/11/15 09:32:52:068 EST [DEBUG] DefaultClientConnection - Receiving
response: HTTP/1.1 401 Unauthorized
2011/11/15 09:32:52:068 EST [DEBUG] headers - << HTTP/1.1 401 Unauthorized
2011/11/15 09:32:52:068 EST [DEBUG] headers - << Content-Length: 1656
2011/11/15 09:32:52:068 EST [DEBUG] headers - << Content-Type: text/html
2011/11/15 09:32:52:068 EST [DEBUG] headers - << Server: Microsoft-IIS/6.0
2011/11/15 09:32:52:068 EST [DEBUG] headers - << WWW-Authenticate: Negotiate
2011/11/15 09:32:52:068 EST [DEBUG] headers - << WWW-Authenticate: NTLM
2011/11/15 09:32:52:068 EST [DEBUG] headers - << Date: Tue, 15 Nov 2011
14:32:51 GMT
2011/11/15 09:32:52:068 EST [DEBUG] DefaultHttpClient - Connection can be
kept alive indefinitely
2011/11/15 09:32:52:068 EST [DEBUG] DefaultHttpClient - wkqasv0304:80
requested authentication
2011/11/15 09:32:52:068 EST [DEBUG] TargetAuthenticationStrategy -
Authentication schemes in the order of preference: [negotiate, NTLM,
Digest, Basic]
2011/11/15 09:32:52:068 EST [DEBUG] NegotiateScheme - Received challenge ''
from the auth server
2011/11/15 09:32:52:068 EST [DEBUG] TargetAuthenticationStrategy -
Challenge for Digest authentication scheme not available
2011/11/15 09:32:52:068 EST [DEBUG] TargetAuthenticationStrategy -
Challenge for Basic authentication scheme not available
----------------------------------------
HTTP/1.1 401 Unauthorized
2011/11/15 09:32:52:068 EST [DEBUG] PoolingClientConnectionManager -
Connection [id: 0][route: {}->http://wkqasv0304] can be kept alive
indefinitely
2011/11/15 09:32:52:068 EST [DEBUG] PoolingClientConnectionManager -
Connection released: [id: 0][route: {}->http://wkqasv0304][total kept
alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]
----------------------------------------
Trying:: 2
executing request GET
http://wkqasv0304/cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/15 09:32:52:068 EST [DEBUG] PoolingClientConnectionManager -
Connection request: [route: {}->http://wkqasv0304][total kept alive: 1;
route allocated: 1 of 2; total allocated: 1 of 20]
2011/11/15 09:32:52:083 EST [DEBUG] PoolingClientConnectionManager -
Connection leased: [id: 0][route: {}->http://wkqasv0304][total kept alive:
0; route allocated: 1 of 2; total allocated: 1 of 20]
2011/11/15 09:32:52:083 EST [DEBUG] DefaultHttpClient - Stale connection
check
2011/11/15 09:32:52:099 EST [DEBUG] RequestAddCookies - CookieSpec
selected: best-match
2011/11/15 09:32:52:099 EST [DEBUG] RequestAuthCache - Auth cache not set
in the context
2011/11/15 09:32:52:099 EST [DEBUG] RequestTargetAuthentication - Target
auth state: UNCHALLENGED
2011/11/15 09:32:52:099 EST [DEBUG] RequestProxyAuthentication - Proxy auth
state: UNCHALLENGED
2011/11/15 09:32:52:099 EST [DEBUG] DefaultHttpClient - Attempt 1 to
execute request
2011/11/15 09:32:52:099 EST [DEBUG] DefaultClientConnection - Sending
request: GET /cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/15 09:32:52:099 EST [DEBUG] headers - >> GET
/cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/15 09:32:52:099 EST [DEBUG] headers - >> Host: wkqasv0304
2011/11/15 09:32:52:099 EST [DEBUG] headers - >> Connection: Keep-Alive
2011/11/15 09:32:52:099 EST [DEBUG] headers - >> User-Agent:
Apache-HttpClient/4.2-alpha1 (java 1.5)
2011/11/15 09:32:52:099 EST [DEBUG] DefaultClientConnection - Receiving
response: HTTP/1.1 401 Unauthorized
2011/11/15 09:32:52:099 EST [DEBUG] headers - << HTTP/1.1 401 Unauthorized
2011/11/15 09:32:52:099 EST [DEBUG] headers - << Content-Length: 1656
2011/11/15 09:32:52:099 EST [DEBUG] headers - << Content-Type: text/html
2011/11/15 09:32:52:099 EST [DEBUG] headers - << Server: Microsoft-IIS/6.0
2011/11/15 09:32:52:099 EST [DEBUG] headers - << WWW-Authenticate: Negotiate
2011/11/15 09:32:52:099 EST [DEBUG] headers - << WWW-Authenticate: NTLM
2011/11/15 09:32:52:099 EST [DEBUG] headers - << Date: Tue, 15 Nov 2011
14:32:51 GMT
2011/11/15 09:32:52:099 EST [DEBUG] DefaultHttpClient - Connection can be
kept alive indefinitely
2011/11/15 09:32:52:099 EST [DEBUG] DefaultHttpClient - wkqasv0304:80
requested authentication
2011/11/15 09:32:52:099 EST [DEBUG] TargetAuthenticationStrategy -
Authentication schemes in the order of preference: [negotiate, NTLM,
Digest, Basic]
2011/11/15 09:32:52:099 EST [DEBUG] NegotiateScheme - Received challenge ''
from the auth server
2011/11/15 09:32:52:099 EST [DEBUG] TargetAuthenticationStrategy -
Challenge for Digest authentication scheme not available
2011/11/15 09:32:52:099 EST [DEBUG] TargetAuthenticationStrategy -
Challenge for Basic authentication scheme not available
2011/11/15 09:32:52:099 EST [DEBUG] RequestAddCookies - CookieSpec
selected: best-match
2011/11/15 09:32:52:099 EST [DEBUG] RequestAuthCache - Auth cache not set
in the context
2011/11/15 09:32:52:099 EST [DEBUG] RequestTargetAuthentication - Target
auth state: CHALLENGED
2011/11/15 09:32:52:099 EST [DEBUG] RequestTargetAuthentication -
Generating response to an authentication challenge using Negotiate scheme
2011/11/15 09:32:52:099 EST [DEBUG] NegotiateScheme - init wkqasv0304
2011/11/15 09:32:52:130 EST [WARN] RequestTargetAuthentication - NEGOTIATE
authentication error: Invalid name provided (Mechanism level: Could not
load configuration file C:\Windows\krb5.ini (The system cannot find the
file specified))
2011/11/15 09:32:52:130 EST [DEBUG] RequestTargetAuthentication -
Generating response to an authentication challenge using ntlm scheme
2011/11/15 09:32:52:130 EST [DEBUG] RequestProxyAuthentication - Proxy auth
state: UNCHALLENGED
2011/11/15 09:32:52:130 EST [DEBUG] DefaultHttpClient - Attempt 2 to
execute request
2011/11/15 09:32:52:130 EST [DEBUG] DefaultClientConnection - Sending
request: GET /cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/15 09:32:52:130 EST [DEBUG] headers - >> GET
/cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/15 09:32:52:130 EST [DEBUG] headers - >> Host: wkqasv0304
2011/11/15 09:32:52:130 EST [DEBUG] headers - >> Connection: Keep-Alive
2011/11/15 09:32:52:130 EST [DEBUG] headers - >> User-Agent:
Apache-HttpClient/4.2-alpha1 (java 1.5)
2011/11/15 09:32:52:130 EST [DEBUG] headers - >> Authorization: NTLM
TlRMTVNTUAABAAAANQIIIAwADAA0AAAAFAAUACAAAABXAEsAUQBBAFMAVgAwADMAMAA0AEcATABPAEIAQQBMAA==
2011/11/15 09:32:52:130 EST [DEBUG] DefaultClientConnection - Receiving
response: HTTP/1.1 401 Unauthorized
2011/11/15 09:32:52:130 EST [DEBUG] headers - << HTTP/1.1 401 Unauthorized
2011/11/15 09:32:52:130 EST [DEBUG] headers - << Content-Length: 1539
2011/11/15 09:32:52:130 EST [DEBUG] headers - << Content-Type: text/html
2011/11/15 09:32:52:130 EST [DEBUG] headers - << Server: Microsoft-IIS/6.0
2011/11/15 09:32:52:130 EST [DEBUG] headers - << WWW-Authenticate: NTLM
TlRMTVNTUAACAAAADAAMADgAAAA1Aokioz2NReOdjjEAAAAAAAAAAJoAmgBEAAAABQLODgAAAA9HAEwATwBCAEEATAACAAwARwBMAE8AQgBBAEwAAQAUAFcASwBRAEEAUwBWADAAMwAwADQABAAeAGcAbABvAGIAYQBsAC4AcwBkAGwALgBjAG8AcgBwAAMANAB3AGsAcQBhAHMAdgAwADMAMAA0AC4AZwBsAG8AYgBhAGwALgBzAGQAbAAuAGMAbwByAHAABQAQAHMAZABsAC4AYwBvAHIAcAAAAAAA
2011/11/15 09:32:52:130 EST [DEBUG] headers - << Date: Tue, 15 Nov 2011
14:32:51 GMT
2011/11/15 09:32:52:130 EST [DEBUG] DefaultHttpClient - Connection can be
kept alive indefinitely
2011/11/15 09:32:52:130 EST [DEBUG] DefaultHttpClient - wkqasv0304:80
requested authentication
2011/11/15 09:32:52:130 EST [DEBUG] DefaultHttpClient - Authorization
challenge processed
2011/11/15 09:32:52:130 EST [DEBUG] RequestAddCookies - CookieSpec
selected: best-match
2011/11/15 09:32:52:130 EST [DEBUG] RequestAuthCache - Auth cache not set
in the context
2011/11/15 09:32:52:130 EST [DEBUG] RequestTargetAuthentication - Target
auth state: HANDSHAKE
2011/11/15 09:32:52:130 EST [DEBUG] RequestProxyAuthentication - Proxy auth
state: UNCHALLENGED
2011/11/15 09:32:52:130 EST [DEBUG] DefaultHttpClient - Attempt 3 to
execute request
2011/11/15 09:32:52:130 EST [DEBUG] DefaultClientConnection - Sending
request: GET /cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/15 09:32:52:130 EST [DEBUG] headers - >> GET
/cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/15 09:32:52:130 EST [DEBUG] headers - >> Host: wkqasv0304
2011/11/15 09:32:52:130 EST [DEBUG] headers - >> Connection: Keep-Alive
2011/11/15 09:32:52:130 EST [DEBUG] headers - >> User-Agent:
Apache-HttpClient/4.2-alpha1 (java 1.5)
2011/11/15 09:32:52:130 EST [DEBUG] headers - >> Authorization: NTLM
TlRMTVNTUAADAAAAGAAYAEAAAADGAMYAWAAAAAwADAAeAQAAGgAaACoBAAAUABQARAEAAAAAAABYAQAANQIIILSQ0oov0UPrrEPz9qPc3yv+kmCyOZd7DQvlcbZj8y0jhZwR7wjytMsBAQAAAAAAACAYynSjo8wB/pJgsjmXew0AAAAAAgAMAEcATABPAEIAQQBMAAEAFABXAEsAUQBBAFMAVgAwADMAMAA0AAQAHgBnAGwAbwBiAGEAbAAuAHMAZABsAC4AYwBvAHIAcAADADQAdwBrAHEAYQBzAHYAMAAzADAANAAuAGcAbABvAGIAYQBsAC4AcwBkAGwALgBjAG8AcgBwAAUAEABzAGQAbAAuAGMAbwByAHAAAAAAAEcATABPAEIAQQBMAGEAZABtAGkAbgBpAHMAdAByAGEAdABvAHIAVwBLAFEAQQBTAFYAMAAzADAANAA=
2011/11/15 09:32:52:255 EST [DEBUG] DefaultClientConnection - Receiving
response: HTTP/1.1 500 Internal Server Error
2011/11/15 09:32:52:255 EST [DEBUG] headers - << HTTP/1.1 500 Internal
Server Error
2011/11/15 09:32:52:255 EST [DEBUG] headers - << Content-Length: 112
2011/11/15 09:32:52:255 EST [DEBUG] headers - << Content-Type: text/html
2011/11/15 09:32:52:255 EST [DEBUG] headers - << Server: Microsoft-IIS/6.0
2011/11/15 09:32:52:255 EST [DEBUG] headers - << Date: Tue, 15 Nov 2011
14:32:51 GMT
2011/11/15 09:32:52:255 EST [DEBUG] headers - << Connection: close
----------------------------------------
HTTP/1.1 500 Internal Server Error
2011/11/15 09:32:52:255 EST [DEBUG] PoolingClientConnectionManager -
Connection [id: 0][route: {}->http://wkqasv0304][state:
GLOBAL/administrator] can be kept alive indefinitely
2011/11/15 09:32:52:255 EST [DEBUG] PoolingClientConnectionManager -
Connection released: [id: 0][route: {}->http://wkqasv0304][state:
GLOBAL/administrator][total kept alive: 1; route allocated: 1 of 2; total
allocated: 1 of 20]
2011/11/15 09:32:52:255 EST [DEBUG] PoolingClientConnectionManager -
Connection manager is shutting down
2011/11/15 09:32:52:255 EST [DEBUG] DefaultClientConnection - Connection
0.0.0.0:55123<->10.102.11.40:80 closed
2011/11/15 09:32:52:255 EST [DEBUG] DefaultClientConnection - Connection
0.0.0.0:55123<->10.102.11.40:80 closed
2011/11/15 09:32:52:255 EST [DEBUG] PoolingClientConnectionManager -
Connection manager shut down








On Tue, Nov 15, 2011 at 3:51 AM, Oleg Kalnichevski <ol...@apache.org> wrote:

> On Mon, Nov 14, 2011 at 11:51:36AM -0500, Milind Kadam wrote:
> > Hi Oleg,
> >
> > I commented the line which use "AuthScheme" to print the Realm to console
> > and generated the output. Don't know whether this will help or not; but
> > with correct username/password; it fails to connect to IIS 6 web server
> > when "Integrated Windows authentication" is set.
> > Thanks,
> > Milind
> >
> >
>
> ...
>
> > 2011/11/14 11:43:16:322 EST [DEBUG] RequestTargetAuthentication -
> > Generating response to an authentication challenge using ntlm scheme
> > 2011/11/14 11:43:16:322 EST [WARN] RequestTargetAuthentication - NTLM
> > authentication error: Credentials cannot be used for NTLM authentication:
> > org.apache.http.auth.UsernamePasswordCredentials
>
> You are using UsernamePasswordCredentials that are not sufficient for NTLM
> authentication. You should be using NTCrednetials instead.
>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

Re: JAVA Client on Windows 7 talking to ISS 6 with no HTTPs but Integrated Windows Authentication turned ON

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, Nov 14, 2011 at 11:51:36AM -0500, Milind Kadam wrote:
> Hi Oleg,
> 
> I commented the line which use "AuthScheme" to print the Realm to console
> and generated the output. Don't know whether this will help or not; but
> with correct username/password; it fails to connect to IIS 6 web server
> when "Integrated Windows authentication" is set.
> Thanks,
> Milind
> 
> 

...

> 2011/11/14 11:43:16:322 EST [DEBUG] RequestTargetAuthentication -
> Generating response to an authentication challenge using ntlm scheme
> 2011/11/14 11:43:16:322 EST [WARN] RequestTargetAuthentication - NTLM
> authentication error: Credentials cannot be used for NTLM authentication:
> org.apache.http.auth.UsernamePasswordCredentials

You are using UsernamePasswordCredentials that are not sufficient for NTLM authentication. You should be using NTCrednetials instead.

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: JAVA Client on Windows 7 talking to ISS 6 with no HTTPs but Integrated Windows Authentication turned ON

Posted by Milind Kadam <ka...@gmail.com>.
Hi Oleg,

I commented the line which use "AuthScheme" to print the Realm to console
and generated the output. Don't know whether this will help or not; but
with correct username/password; it fails to connect to IIS 6 web server
when "Integrated Windows authentication" is set.
Thanks,
Milind


Trying:: 1
executing request GET
http://wkqasv0304/cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/14 11:43:16:244 EST [DEBUG] PoolingClientConnectionManager -
Connection request: [route: {}->http://wkqasv0304][total kept alive: 0;
route allocated: 0 of 2; total allocated: 0 of 20]
2011/11/14 11:43:16:259 EST [DEBUG] PoolingClientConnectionManager -
Connection leased: [id: 0][route: {}->http://wkqasv0304][total kept alive:
0; route allocated: 1 of 2; total allocated: 1 of 20]
2011/11/14 11:43:16:259 EST [DEBUG] DefaultClientConnectionOperator -
Connecting to wkqasv0304:80
2011/11/14 11:43:16:259 EST [DEBUG] RequestAddCookies - CookieSpec
selected: best-match
2011/11/14 11:43:16:275 EST [DEBUG] RequestAuthCache - Auth cache not set
in the context
2011/11/14 11:43:16:275 EST [DEBUG] RequestTargetAuthentication - Target
auth state: UNCHALLENGED
2011/11/14 11:43:16:275 EST [DEBUG] RequestProxyAuthentication - Proxy auth
state: UNCHALLENGED
2011/11/14 11:43:16:275 EST [DEBUG] DefaultHttpClient - Attempt 1 to
execute request
2011/11/14 11:43:16:275 EST [DEBUG] DefaultClientConnection - Sending
request: GET /cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/14 11:43:16:275 EST [DEBUG] headers - >> GET
/cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/14 11:43:16:275 EST [DEBUG] headers - >> Host: wkqasv0304
2011/11/14 11:43:16:275 EST [DEBUG] headers - >> Connection: Keep-Alive
2011/11/14 11:43:16:275 EST [DEBUG] headers - >> User-Agent:
Apache-HttpClient/4.2-alpha1 (java 1.5)
2011/11/14 11:43:16:275 EST [DEBUG] DefaultClientConnection - Receiving
response: HTTP/1.1 401 Unauthorized
2011/11/14 11:43:16:275 EST [DEBUG] headers - << HTTP/1.1 401 Unauthorized
2011/11/14 11:43:16:275 EST [DEBUG] headers - << Content-Length: 1656
2011/11/14 11:43:16:275 EST [DEBUG] headers - << Content-Type: text/html
2011/11/14 11:43:16:275 EST [DEBUG] headers - << Server: Microsoft-IIS/6.0
2011/11/14 11:43:16:275 EST [DEBUG] headers - << WWW-Authenticate: Negotiate
2011/11/14 11:43:16:275 EST [DEBUG] headers - << WWW-Authenticate: NTLM
2011/11/14 11:43:16:275 EST [DEBUG] headers - << Date: Mon, 14 Nov 2011
16:43:15 GMT
2011/11/14 11:43:16:275 EST [DEBUG] DefaultHttpClient - Connection can be
kept alive indefinitely
2011/11/14 11:43:16:275 EST [DEBUG] DefaultHttpClient - wkqasv0304:80
requested authentication
2011/11/14 11:43:16:275 EST [DEBUG] TargetAuthenticationStrategy -
Authentication schemes in the order of preference: [negotiate, NTLM,
Digest, Basic]
2011/11/14 11:43:16:275 EST [DEBUG] NegotiateScheme - Received challenge ''
from the auth server
2011/11/14 11:43:16:291 EST [DEBUG] TargetAuthenticationStrategy -
Challenge for Digest authentication scheme not available
2011/11/14 11:43:16:291 EST [DEBUG] TargetAuthenticationStrategy -
Challenge for Basic authentication scheme not available
----------------------------------------
HTTP/1.1 401 Unauthorized
2011/11/14 11:43:16:291 EST [DEBUG] PoolingClientConnectionManager -
Connection [id: 0][route: {}->http://wkqasv0304] can be kept alive
indefinitely
2011/11/14 11:43:16:291 EST [DEBUG] PoolingClientConnectionManager -
Connection released: [id: 0][route: {}->http://wkqasv0304][total kept
alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]
----------------------------------------
Trying:: 2
executing request GET
http://wkqasv0304/cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/14 11:43:16:291 EST [DEBUG] PoolingClientConnectionManager -
Connection request: [route: {}->http://wkqasv0304][total kept alive: 1;
route allocated: 1 of 2; total allocated: 1 of 20]
2011/11/14 11:43:16:291 EST [DEBUG] PoolingClientConnectionManager -
Connection leased: [id: 0][route: {}->http://wkqasv0304][total kept alive:
0; route allocated: 1 of 2; total allocated: 1 of 20]
2011/11/14 11:43:16:291 EST [DEBUG] DefaultHttpClient - Stale connection
check
2011/11/14 11:43:16:306 EST [DEBUG] RequestAddCookies - CookieSpec
selected: best-match
2011/11/14 11:43:16:306 EST [DEBUG] RequestAuthCache - Auth cache not set
in the context
2011/11/14 11:43:16:306 EST [DEBUG] RequestTargetAuthentication - Target
auth state: UNCHALLENGED
2011/11/14 11:43:16:306 EST [DEBUG] RequestProxyAuthentication - Proxy auth
state: UNCHALLENGED
2011/11/14 11:43:16:306 EST [DEBUG] DefaultHttpClient - Attempt 1 to
execute request
2011/11/14 11:43:16:306 EST [DEBUG] DefaultClientConnection - Sending
request: GET /cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/14 11:43:16:306 EST [DEBUG] headers - >> GET
/cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/14 11:43:16:306 EST [DEBUG] headers - >> Host: wkqasv0304
2011/11/14 11:43:16:306 EST [DEBUG] headers - >> Connection: Keep-Alive
2011/11/14 11:43:16:306 EST [DEBUG] headers - >> User-Agent:
Apache-HttpClient/4.2-alpha1 (java 1.5)
2011/11/14 11:43:16:306 EST [DEBUG] DefaultClientConnection - Receiving
response: HTTP/1.1 401 Unauthorized
2011/11/14 11:43:16:306 EST [DEBUG] headers - << HTTP/1.1 401 Unauthorized
2011/11/14 11:43:16:306 EST [DEBUG] headers - << Content-Length: 1656
2011/11/14 11:43:16:306 EST [DEBUG] headers - << Content-Type: text/html
2011/11/14 11:43:16:306 EST [DEBUG] headers - << Server: Microsoft-IIS/6.0
2011/11/14 11:43:16:306 EST [DEBUG] headers - << WWW-Authenticate: Negotiate
2011/11/14 11:43:16:306 EST [DEBUG] headers - << WWW-Authenticate: NTLM
2011/11/14 11:43:16:306 EST [DEBUG] headers - << Date: Mon, 14 Nov 2011
16:43:15 GMT
2011/11/14 11:43:16:306 EST [DEBUG] DefaultHttpClient - Connection can be
kept alive indefinitely
2011/11/14 11:43:16:306 EST [DEBUG] DefaultHttpClient - wkqasv0304:80
requested authentication
2011/11/14 11:43:16:306 EST [DEBUG] TargetAuthenticationStrategy -
Authentication schemes in the order of preference: [negotiate, NTLM,
Digest, Basic]
2011/11/14 11:43:16:306 EST [DEBUG] NegotiateScheme - Received challenge ''
from the auth server
2011/11/14 11:43:16:306 EST [DEBUG] TargetAuthenticationStrategy -
Challenge for Digest authentication scheme not available
2011/11/14 11:43:16:306 EST [DEBUG] TargetAuthenticationStrategy -
Challenge for Basic authentication scheme not available
2011/11/14 11:43:16:306 EST [DEBUG] RequestAddCookies - CookieSpec
selected: best-match
2011/11/14 11:43:16:306 EST [DEBUG] RequestAuthCache - Auth cache not set
in the context
2011/11/14 11:43:16:306 EST [DEBUG] RequestTargetAuthentication - Target
auth state: CHALLENGED
2011/11/14 11:43:16:306 EST [DEBUG] RequestTargetAuthentication -
Generating response to an authentication challenge using Negotiate scheme
2011/11/14 11:43:16:306 EST [DEBUG] NegotiateScheme - init wkqasv0304
2011/11/14 11:43:16:322 EST [WARN] RequestTargetAuthentication - NEGOTIATE
authentication error: Invalid name provided (Mechanism level: Could not
load configuration file C:\Windows\krb5.ini (The system cannot find the
file specified))
2011/11/14 11:43:16:322 EST [DEBUG] RequestTargetAuthentication -
Generating response to an authentication challenge using ntlm scheme
2011/11/14 11:43:16:322 EST [WARN] RequestTargetAuthentication - NTLM
authentication error: Credentials cannot be used for NTLM authentication:
org.apache.http.auth.UsernamePasswordCredentials
2011/11/14 11:43:16:322 EST [DEBUG] RequestProxyAuthentication - Proxy auth
state: UNCHALLENGED
2011/11/14 11:43:16:322 EST [DEBUG] DefaultHttpClient - Attempt 2 to
execute request
2011/11/14 11:43:16:322 EST [DEBUG] DefaultClientConnection - Sending
request: GET /cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/14 11:43:16:337 EST [DEBUG] headers - >> GET
/cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/14 11:43:16:337 EST [DEBUG] headers - >> Host: wkqasv0304
2011/11/14 11:43:16:337 EST [DEBUG] headers - >> Connection: Keep-Alive
2011/11/14 11:43:16:337 EST [DEBUG] headers - >> User-Agent:
Apache-HttpClient/4.2-alpha1 (java 1.5)
2011/11/14 11:43:16:337 EST [DEBUG] DefaultClientConnection - Receiving
response: HTTP/1.1 401 Unauthorized
2011/11/14 11:43:16:337 EST [DEBUG] headers - << HTTP/1.1 401 Unauthorized
2011/11/14 11:43:16:337 EST [DEBUG] headers - << Content-Length: 1656
2011/11/14 11:43:16:337 EST [DEBUG] headers - << Content-Type: text/html
2011/11/14 11:43:16:337 EST [DEBUG] headers - << Server: Microsoft-IIS/6.0
2011/11/14 11:43:16:337 EST [DEBUG] headers - << WWW-Authenticate: Negotiate
2011/11/14 11:43:16:337 EST [DEBUG] headers - << WWW-Authenticate: NTLM
2011/11/14 11:43:16:337 EST [DEBUG] headers - << Date: Mon, 14 Nov 2011
16:43:15 GMT
2011/11/14 11:43:16:337 EST [DEBUG] DefaultHttpClient - Connection can be
kept alive indefinitely
2011/11/14 11:43:16:337 EST [DEBUG] DefaultHttpClient - wkqasv0304:80
requested authentication
2011/11/14 11:43:16:337 EST [DEBUG] DefaultHttpClient - Authorization
challenge processed
2011/11/14 11:43:16:337 EST [DEBUG] DefaultHttpClient - Authentication
failed
----------------------------------------
HTTP/1.1 401 Unauthorized
2011/11/14 11:43:16:337 EST [DEBUG] PoolingClientConnectionManager -
Connection [id: 0][route: {}->http://wkqasv0304] can be kept alive
indefinitely
2011/11/14 11:43:16:337 EST [DEBUG] PoolingClientConnectionManager -
Connection released: [id: 0][route: {}->http://wkqasv0304][total kept
alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]
----------------------------------------
Trying:: 3
executing request GET
http://wkqasv0304/cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/14 11:43:16:337 EST [DEBUG] PoolingClientConnectionManager -
Connection request: [route: {}->http://wkqasv0304][total kept alive: 1;
route allocated: 1 of 2; total allocated: 1 of 20]
2011/11/14 11:43:16:337 EST [DEBUG] PoolingClientConnectionManager -
Connection leased: [id: 0][route: {}->http://wkqasv0304][total kept alive:
0; route allocated: 1 of 2; total allocated: 1 of 20]
2011/11/14 11:43:16:337 EST [DEBUG] DefaultHttpClient - Stale connection
check
2011/11/14 11:43:16:353 EST [DEBUG] RequestAddCookies - CookieSpec
selected: best-match
2011/11/14 11:43:16:353 EST [DEBUG] RequestAuthCache - Auth cache not set
in the context
2011/11/14 11:43:16:353 EST [DEBUG] RequestTargetAuthentication - Target
auth state: UNCHALLENGED
2011/11/14 11:43:16:353 EST [DEBUG] RequestProxyAuthentication - Proxy auth
state: UNCHALLENGED
2011/11/14 11:43:16:353 EST [DEBUG] DefaultHttpClient - Attempt 1 to
execute request
2011/11/14 11:43:16:353 EST [DEBUG] DefaultClientConnection - Sending
request: GET /cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/14 11:43:16:353 EST [DEBUG] headers - >> GET
/cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/14 11:43:16:353 EST [DEBUG] headers - >> Host: wkqasv0304
2011/11/14 11:43:16:353 EST [DEBUG] headers - >> Connection: Keep-Alive
2011/11/14 11:43:16:353 EST [DEBUG] headers - >> User-Agent:
Apache-HttpClient/4.2-alpha1 (java 1.5)
2011/11/14 11:43:16:353 EST [DEBUG] DefaultClientConnection - Receiving
response: HTTP/1.1 401 Unauthorized
2011/11/14 11:43:16:353 EST [DEBUG] headers - << HTTP/1.1 401 Unauthorized
2011/11/14 11:43:16:353 EST [DEBUG] headers - << Content-Length: 1656
2011/11/14 11:43:16:353 EST [DEBUG] headers - << Content-Type: text/html
2011/11/14 11:43:16:353 EST [DEBUG] headers - << Server: Microsoft-IIS/6.0
2011/11/14 11:43:16:353 EST [DEBUG] headers - << WWW-Authenticate: Negotiate
2011/11/14 11:43:16:353 EST [DEBUG] headers - << WWW-Authenticate: NTLM
2011/11/14 11:43:16:353 EST [DEBUG] headers - << Date: Mon, 14 Nov 2011
16:43:15 GMT
2011/11/14 11:43:16:353 EST [DEBUG] DefaultHttpClient - Connection can be
kept alive indefinitely
2011/11/14 11:43:16:353 EST [DEBUG] DefaultHttpClient - wkqasv0304:80
requested authentication
2011/11/14 11:43:16:353 EST [DEBUG] TargetAuthenticationStrategy -
Authentication schemes in the order of preference: [negotiate, NTLM,
Digest, Basic]
2011/11/14 11:43:16:353 EST [DEBUG] NegotiateScheme - Received challenge ''
from the auth server
2011/11/14 11:43:16:353 EST [DEBUG] TargetAuthenticationStrategy -
Challenge for Digest authentication scheme not available
2011/11/14 11:43:16:353 EST [DEBUG] TargetAuthenticationStrategy -
Challenge for Basic authentication scheme not available
2011/11/14 11:43:16:353 EST [DEBUG] RequestAddCookies - CookieSpec
selected: best-match
2011/11/14 11:43:16:353 EST [DEBUG] RequestAuthCache - Auth cache not set
in the context
2011/11/14 11:43:16:353 EST [DEBUG] RequestTargetAuthentication - Target
auth state: CHALLENGED
2011/11/14 11:43:16:353 EST [DEBUG] RequestTargetAuthentication -
Generating response to an authentication challenge using Negotiate scheme
2011/11/14 11:43:16:353 EST [DEBUG] NegotiateScheme - init wkqasv0304
2011/11/14 11:43:16:353 EST [WARN] RequestTargetAuthentication - NEGOTIATE
authentication error: Invalid name provided (Mechanism level: Could not
load configuration file C:\Windows\krb5.ini (The system cannot find the
file specified))
2011/11/14 11:43:16:353 EST [DEBUG] RequestTargetAuthentication -
Generating response to an authentication challenge using ntlm scheme
2011/11/14 11:43:16:353 EST [WARN] RequestTargetAuthentication - NTLM
authentication error: Credentials cannot be used for NTLM authentication:
org.apache.http.auth.UsernamePasswordCredentials
2011/11/14 11:43:16:353 EST [DEBUG] RequestProxyAuthentication - Proxy auth
state: UNCHALLENGED
2011/11/14 11:43:16:353 EST [DEBUG] DefaultHttpClient - Attempt 2 to
execute request
2011/11/14 11:43:16:353 EST [DEBUG] DefaultClientConnection - Sending
request: GET /cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/14 11:43:16:353 EST [DEBUG] headers - >> GET
/cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/14 11:43:16:353 EST [DEBUG] headers - >> Host: wkqasv0304
2011/11/14 11:43:16:353 EST [DEBUG] headers - >> Connection: Keep-Alive
2011/11/14 11:43:16:353 EST [DEBUG] headers - >> User-Agent:
Apache-HttpClient/4.2-alpha1 (java 1.5)
2011/11/14 11:43:16:353 EST [DEBUG] DefaultClientConnection - Receiving
response: HTTP/1.1 401 Unauthorized
2011/11/14 11:43:16:353 EST [DEBUG] headers - << HTTP/1.1 401 Unauthorized
2011/11/14 11:43:16:353 EST [DEBUG] headers - << Content-Length: 1656
2011/11/14 11:43:16:353 EST [DEBUG] headers - << Content-Type: text/html
2011/11/14 11:43:16:353 EST [DEBUG] headers - << Server: Microsoft-IIS/6.0
2011/11/14 11:43:16:353 EST [DEBUG] headers - << WWW-Authenticate: Negotiate
2011/11/14 11:43:16:353 EST [DEBUG] headers - << WWW-Authenticate: NTLM
2011/11/14 11:43:16:353 EST [DEBUG] headers - << Date: Mon, 14 Nov 2011
16:43:15 GMT
2011/11/14 11:43:16:353 EST [DEBUG] DefaultHttpClient - Connection can be
kept alive indefinitely
2011/11/14 11:43:16:353 EST [DEBUG] DefaultHttpClient - wkqasv0304:80
requested authentication
2011/11/14 11:43:16:353 EST [DEBUG] DefaultHttpClient - Authorization
challenge processed
2011/11/14 11:43:16:353 EST [DEBUG] DefaultHttpClient - Authentication
failed
----------------------------------------
HTTP/1.1 401 Unauthorized
2011/11/14 11:43:16:353 EST [DEBUG] PoolingClientConnectionManager -
Connection [id: 0][route: {}->http://wkqasv0304] can be kept alive
indefinitely
2011/11/14 11:43:16:353 EST [DEBUG] PoolingClientConnectionManager -
Connection released: [id: 0][route: {}->http://wkqasv0304][total kept
alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]
----------------------------------------
2011/11/14 11:43:16:353 EST [DEBUG] PoolingClientConnectionManager -
Connection manager is shutting down
2011/11/14 11:43:16:353 EST [DEBUG] DefaultClientConnection - Connection
0.0.0.0:49269<->10.102.11.40:80 closed
2011/11/14 11:43:16:353 EST [DEBUG] DefaultClientConnection - Connection
0.0.0.0:49269<->10.102.11.40:80 closed
2011/11/14 11:43:16:353 EST [DEBUG] PoolingClientConnectionManager -
Connection manager shut down



On Mon, Nov 14, 2011 at 11:20 AM, Milind Kadam <ka...@gmail.com>wrote:

>
> Hi Oleg,
>
> Thanks a lot for help.
>
> Following is the log requested.
>
> executing request GET
> http://wkqasv0304/cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
> 2011/11/14 11:16:52:879 EST [DEBUG] PoolingClientConnectionManager -
> Connection request: [route: {}->http://wkqasv0304][total kept alive: 0;
> route allocated: 0 of 2; total allocated: 0 of 20]
> 2011/11/14 11:16:52:879 EST [DEBUG] PoolingClientConnectionManager -
> Connection leased: [id: 0][route: {}->http://wkqasv0304][total kept
> alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
> 2011/11/14 11:16:52:895 EST [DEBUG] DefaultClientConnectionOperator -
> Connecting to wkqasv0304:80
> 2011/11/14 11:16:52:910 EST [DEBUG] RequestAddCookies - CookieSpec
> selected: best-match
> 2011/11/14 11:16:52:910 EST [DEBUG] RequestAuthCache - Auth cache not set
> in the context
> 2011/11/14 11:16:52:910 EST [DEBUG] RequestTargetAuthentication - Target
> auth state: UNCHALLENGED
> 2011/11/14 11:16:52:910 EST [DEBUG] RequestProxyAuthentication - Proxy
> auth state: UNCHALLENGED
> 2011/11/14 11:16:52:910 EST [DEBUG] DefaultHttpClient - Attempt 1 to
> execute request
> 2011/11/14 11:16:52:910 EST [DEBUG] DefaultClientConnection - Sending
> request: GET /cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
> 2011/11/14 11:16:52:910 EST [DEBUG] headers - >> GET
> /cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
> 2011/11/14 11:16:52:910 EST [DEBUG] headers - >> Host: wkqasv0304
> 2011/11/14 11:16:52:910 EST [DEBUG] headers - >> Connection: Keep-Alive
> 2011/11/14 11:16:52:910 EST [DEBUG] headers - >> User-Agent:
> Apache-HttpClient/4.2-alpha1 (java 1.5)
> 2011/11/14 11:16:52:941 EST [DEBUG] DefaultClientConnection - Receiving
> response: HTTP/1.1 401 Unauthorized
> 2011/11/14 11:16:52:941 EST [DEBUG] headers - << HTTP/1.1 401 Unauthorized
> 2011/11/14 11:16:52:941 EST [DEBUG] headers - << Content-Length: 1656
> 2011/11/14 11:16:52:941 EST [DEBUG] headers - << Content-Type: text/html
> 2011/11/14 11:16:52:941 EST [DEBUG] headers - << Server: Microsoft-IIS/6.0
> 2011/11/14 11:16:52:941 EST [DEBUG] headers - << WWW-Authenticate:
> Negotiate
> 2011/11/14 11:16:52:941 EST [DEBUG] headers - << WWW-Authenticate: NTLM
> 2011/11/14 11:16:52:941 EST [DEBUG] headers - << Date: Mon, 14 Nov 2011
> 16:16:52 GMT
> 2011/11/14 11:16:52:941 EST [DEBUG] DefaultHttpClient - Connection can be
> kept alive indefinitely
> 2011/11/14 11:16:52:941 EST [DEBUG] DefaultHttpClient - wkqasv0304:80
> requested authentication
> 2011/11/14 11:16:52:941 EST [DEBUG] TargetAuthenticationStrategy -
> Authentication schemes in the order of preference: [negotiate, NTLM,
> Digest, Basic]
> 2011/11/14 11:16:52:941 EST [DEBUG] NegotiateScheme - Received challenge
> '' from the auth server
> 2011/11/14 11:16:52:941 EST [DEBUG] TargetAuthenticationStrategy -
> Challenge for Digest authentication scheme not available
> 2011/11/14 11:16:52:941 EST [DEBUG] TargetAuthenticationStrategy -
> Challenge for Basic authentication scheme not available
> ----------------------------------------
> HTTP/1.1 401 Unauthorized
> 2011/11/14 11:16:52:941 EST [DEBUG] PoolingClientConnectionManager -
> Connection [id: 0][route: {}->http://wkqasv0304] can be kept alive
> indefinitely
> 2011/11/14 11:16:52:941 EST [DEBUG] PoolingClientConnectionManager -
> Connection released: [id: 0][route: {}->http://wkqasv0304][total kept
> alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]
> ----------------------------------------
> 2011/11/14 11:16:52:941 EST [DEBUG] PoolingClientConnectionManager -
> Connection manager is shutting down
> 2011/11/14 11:16:52:941 EST [DEBUG] DefaultClientConnection - Connection
> 0.0.0.0:59517<->10.102.11.40:80 closed
> 2011/11/14 11:16:52:941 EST [DEBUG] DefaultClientConnection - Connection
> 0.0.0.0:59517<->10.102.11.40:80 closed
> 2011/11/14 11:16:52:941 EST [DEBUG] PoolingClientConnectionManager -
> Connection manager shut down
> Exception in thread "main" java.lang.NullPointerException
>  at
> clientauthentication.ClientAuthentication.main(ClientAuthentication.java:105)
>
>
>
> On Mon, Nov 14, 2011 at 10:03 AM, Oleg Kalnichevski <ol...@apache.org>wrote:
>
>> On Mon, Nov 14, 2011 at 09:29:10AM -0500, Milind Kadam wrote:
>> > Hi There,
>> >
>> > I am new to HTTPClient and trying to use it to implement JAVA Client
>> which
>> > can talk to Web Server. I wan using URLConnect and everything was
>> working
>> > fine against IIS 6 web server until disabled the anonymous access. So
>> > trying to use the HTTPClient. Example
>> ClientInteractiveAuthentication.java
>> > works fine if I choose Basic authentication but when I set Integrated
>> > Windows authentication; authState.getAuthScheme returns null.
>> >
>> > Any help is appreciated.
>> >
>> > Thanks,
>> > Milind
>>
>> Milind,
>>
>> If you run your applications with the wire / context logging on as
>> described here [1] you should get additional details about request
>> execution process and might be able to see why HttpClient was unable to
>> authenticate when Integrated Windows authentication is activated on the
>> server side.
>>
>> Oleg
>>
>> [1] http://hc.apache.org/httpcomponents-client-ga/logging.html
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>
>>
>

Re: JAVA Client on Windows 7 talking to ISS 6 with no HTTPs but Integrated Windows Authentication turned ON

Posted by Milind Kadam <ka...@gmail.com>.
Hi Oleg,

Thanks a lot for help.

Following is the log requested.

executing request GET
http://wkqasv0304/cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/14 11:16:52:879 EST [DEBUG] PoolingClientConnectionManager -
Connection request: [route: {}->http://wkqasv0304][total kept alive: 0;
route allocated: 0 of 2; total allocated: 0 of 20]
2011/11/14 11:16:52:879 EST [DEBUG] PoolingClientConnectionManager -
Connection leased: [id: 0][route: {}->http://wkqasv0304][total kept alive:
0; route allocated: 1 of 2; total allocated: 1 of 20]
2011/11/14 11:16:52:895 EST [DEBUG] DefaultClientConnectionOperator -
Connecting to wkqasv0304:80
2011/11/14 11:16:52:910 EST [DEBUG] RequestAddCookies - CookieSpec
selected: best-match
2011/11/14 11:16:52:910 EST [DEBUG] RequestAuthCache - Auth cache not set
in the context
2011/11/14 11:16:52:910 EST [DEBUG] RequestTargetAuthentication - Target
auth state: UNCHALLENGED
2011/11/14 11:16:52:910 EST [DEBUG] RequestProxyAuthentication - Proxy auth
state: UNCHALLENGED
2011/11/14 11:16:52:910 EST [DEBUG] DefaultHttpClient - Attempt 1 to
execute request
2011/11/14 11:16:52:910 EST [DEBUG] DefaultClientConnection - Sending
request: GET /cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/14 11:16:52:910 EST [DEBUG] headers - >> GET
/cw_common/servlet/PingCaSServlet?request=init HTTP/1.1
2011/11/14 11:16:52:910 EST [DEBUG] headers - >> Host: wkqasv0304
2011/11/14 11:16:52:910 EST [DEBUG] headers - >> Connection: Keep-Alive
2011/11/14 11:16:52:910 EST [DEBUG] headers - >> User-Agent:
Apache-HttpClient/4.2-alpha1 (java 1.5)
2011/11/14 11:16:52:941 EST [DEBUG] DefaultClientConnection - Receiving
response: HTTP/1.1 401 Unauthorized
2011/11/14 11:16:52:941 EST [DEBUG] headers - << HTTP/1.1 401 Unauthorized
2011/11/14 11:16:52:941 EST [DEBUG] headers - << Content-Length: 1656
2011/11/14 11:16:52:941 EST [DEBUG] headers - << Content-Type: text/html
2011/11/14 11:16:52:941 EST [DEBUG] headers - << Server: Microsoft-IIS/6.0
2011/11/14 11:16:52:941 EST [DEBUG] headers - << WWW-Authenticate: Negotiate
2011/11/14 11:16:52:941 EST [DEBUG] headers - << WWW-Authenticate: NTLM
2011/11/14 11:16:52:941 EST [DEBUG] headers - << Date: Mon, 14 Nov 2011
16:16:52 GMT
2011/11/14 11:16:52:941 EST [DEBUG] DefaultHttpClient - Connection can be
kept alive indefinitely
2011/11/14 11:16:52:941 EST [DEBUG] DefaultHttpClient - wkqasv0304:80
requested authentication
2011/11/14 11:16:52:941 EST [DEBUG] TargetAuthenticationStrategy -
Authentication schemes in the order of preference: [negotiate, NTLM,
Digest, Basic]
2011/11/14 11:16:52:941 EST [DEBUG] NegotiateScheme - Received challenge ''
from the auth server
2011/11/14 11:16:52:941 EST [DEBUG] TargetAuthenticationStrategy -
Challenge for Digest authentication scheme not available
2011/11/14 11:16:52:941 EST [DEBUG] TargetAuthenticationStrategy -
Challenge for Basic authentication scheme not available
----------------------------------------
HTTP/1.1 401 Unauthorized
2011/11/14 11:16:52:941 EST [DEBUG] PoolingClientConnectionManager -
Connection [id: 0][route: {}->http://wkqasv0304] can be kept alive
indefinitely
2011/11/14 11:16:52:941 EST [DEBUG] PoolingClientConnectionManager -
Connection released: [id: 0][route: {}->http://wkqasv0304][total kept
alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]
----------------------------------------
2011/11/14 11:16:52:941 EST [DEBUG] PoolingClientConnectionManager -
Connection manager is shutting down
2011/11/14 11:16:52:941 EST [DEBUG] DefaultClientConnection - Connection
0.0.0.0:59517<->10.102.11.40:80 closed
2011/11/14 11:16:52:941 EST [DEBUG] DefaultClientConnection - Connection
0.0.0.0:59517<->10.102.11.40:80 closed
2011/11/14 11:16:52:941 EST [DEBUG] PoolingClientConnectionManager -
Connection manager shut down
Exception in thread "main" java.lang.NullPointerException
 at
clientauthentication.ClientAuthentication.main(ClientAuthentication.java:105)



On Mon, Nov 14, 2011 at 10:03 AM, Oleg Kalnichevski <ol...@apache.org>wrote:

> On Mon, Nov 14, 2011 at 09:29:10AM -0500, Milind Kadam wrote:
> > Hi There,
> >
> > I am new to HTTPClient and trying to use it to implement JAVA Client
> which
> > can talk to Web Server. I wan using URLConnect and everything was working
> > fine against IIS 6 web server until disabled the anonymous access. So
> > trying to use the HTTPClient. Example
> ClientInteractiveAuthentication.java
> > works fine if I choose Basic authentication but when I set Integrated
> > Windows authentication; authState.getAuthScheme returns null.
> >
> > Any help is appreciated.
> >
> > Thanks,
> > Milind
>
> Milind,
>
> If you run your applications with the wire / context logging on as
> described here [1] you should get additional details about request
> execution process and might be able to see why HttpClient was unable to
> authenticate when Integrated Windows authentication is activated on the
> server side.
>
> Oleg
>
> [1] http://hc.apache.org/httpcomponents-client-ga/logging.html
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>