Thanks a lot for your insight Oleg! I tried using the Java HttpURLConnection with another account and it worked with NTLM and without needing SSL setup.
On 2/16/13 1:51 PM, "Oleg Kalnichevski" <ol...@apache.org> wrote: >On Fri, 2013-02-15 at 15:24 -0500, Chawla, Vanita wrote: >> Thank you Oleg. Here it is: >> > >Vanita, > >SSL does not seem to be a factor. NTLM authentication failure is likely >due to one of two reasons: (1) genuine authentication failure doe to >invalid user credentials or (2) incompatibility between HttpClient and >the web server (identified as Microsoft-IIS/7.5). To rule out the latter >you could try using JCIFS NTLM engine instead of the default one as >described here and see if that fixes the problem [1] > >Oleg > >[1] http://hc.apache.org/httpcomponents-client-ga/ntlm.html > > >> >>https://hostname/sites/team-sites/operations/_vti_bin/owssvr.dll?Cmd%3DDi >>sp >> lay%26List%3D%7B6E460908-D470-4F8A-AF76-CC279E25E0B1%7D%26XMLDATA%3DTRUE >> ---------------------------------------- >> executing request: GET >> >>https://hostname/sites/team-sites/operations/_vti_bin/owssvr.dll?Cmd%3DDi >>sp >> lay%26List%3D%7B6E460908-D470-4F8A-AF76-CC279E25E0B1%7D%26XMLDATA%3DTRUE >> HTTP/1.1 >> to target: https://hostname:443 >> 2013/02/15 18:47:39:008 GMT [DEBUG] BasicClientConnectionManager - Get >> connection for route {s}->https://hostname:443 >> 2013/02/15 18:47:39:009 GMT [DEBUG] DefaultClientConnectionOperator - >> Connecting to hostname:443 >> 2013/02/15 18:47:40:308 GMT [DEBUG] RequestAddCookies - CookieSpec >> selected: best-match >> 2013/02/15 18:47:40:308 GMT [DEBUG] RequestAuthCache - Auth cache not >>set >> in the context >> 2013/02/15 18:47:40:308 GMT [DEBUG] RequestTargetAuthentication - Target >> auth state: UNCHALLENGED >> 2013/02/15 18:47:40:308 GMT [DEBUG] RequestProxyAuthentication - Proxy >> auth state: UNCHALLENGED >> 2013/02/15 18:47:40:308 GMT [DEBUG] DefaultHttpClient - Attempt 1 to >> execute request >> 2013/02/15 18:47:40:308 GMT [DEBUG] DefaultClientConnection - Sending >> request: GET >> >>/sites/team-sites/operations/_vti_bin/owssvr.dll?Cmd%3DDisplay%26List%3D% >>7B >> 6E460908-D470-4F8A-AF76-CC279E25E0B1%7D%26XMLDATA%3DTRUE HTTP/1.1 >> 2013/02/15 18:47:40:309 GMT [DEBUG] wire - >> "GET >> >>/sites/team-sites/operations/_vti_bin/owssvr.dll?Cmd%3DDisplay%26List%3D% >>7B >> 6E460908-D470-4F8A-AF76-CC279E25E0B1%7D%26XMLDATA%3DTRUE >>HTTP/1.1[\r][\n]" >> 2013/02/15 18:47:40:309 GMT [DEBUG] wire - >> "Host: hostname[\r][\n]" >> 2013/02/15 18:47:40:309 GMT [DEBUG] wire - >> "Connection: >> Keep-Alive[\r][\n]" >> 2013/02/15 18:47:40:309 GMT [DEBUG] wire - >> "User-Agent: >> Apache-HttpClient/4.2.3 (java 1.5)[\r][\n]" >> 2013/02/15 18:47:40:309 GMT [DEBUG] wire - >> "[\r][\n]" >> 2013/02/15 18:47:40:309 GMT [DEBUG] headers - >> GET >> >>/sites/team-sites/operations/_vti_bin/owssvr.dll?Cmd%3DDisplay%26List%3D% >>7B >> 6E460908-D470-4F8A-AF76-CC279E25E0B1%7D%26XMLDATA%3DTRUE HTTP/1.1 >> 2013/02/15 18:47:40:309 GMT [DEBUG] headers - >> Host: hostname >> 2013/02/15 18:47:40:309 GMT [DEBUG] headers - >> Connection: Keep-Alive >> 2013/02/15 18:47:40:309 GMT [DEBUG] headers - >> User-Agent: >> Apache-HttpClient/4.2.3 (java 1.5) >> 2013/02/15 18:47:40:372 GMT [DEBUG] wire - << "HTTP/1.1 401 >> Unauthorized[\r][\n]" >> 2013/02/15 18:47:40:372 GMT [DEBUG] wire - << "Connection: >> keep-alive[\r][\n]" >> 2013/02/15 18:47:40:373 GMT [DEBUG] wire - << "Content-Type: text/html; >> charset=utf-8[\r][\n]" >> 2013/02/15 18:47:40:373 GMT [DEBUG] wire - << "Server: >> Microsoft-IIS/7.5[\r][\n]" >> 2013/02/15 18:47:40:373 GMT [DEBUG] wire - << "SPRequestGuid: >> 9590ba88-768e-4eb9-a68b-df45b83606d6[\r][\n]" >> 2013/02/15 18:47:40:373 GMT [DEBUG] wire - << "X-SharePointHealthScore: >> 0[\r][\n]" >> 2013/02/15 18:47:40:373 GMT [DEBUG] wire - << "WWW-Authenticate: >> NTLM[\r][\n]" >> 2013/02/15 18:47:40:373 GMT [DEBUG] wire - << "X-Powered-By: >> ASP.NET[\r][\n]" >> 2013/02/15 18:47:40:373 GMT [DEBUG] wire - << >> "MicrosoftSharePointTeamServices: 14.0.0.6010[\r][\n]" >> 2013/02/15 18:47:40:373 GMT [DEBUG] wire - << "Date: Fri, 15 Feb 2013 >> 18:47:40 GMT[\r][\n]" >> 2013/02/15 18:47:40:373 GMT [DEBUG] wire - << "Content-Length: >>16[\r][\n]" >> 2013/02/15 18:47:40:373 GMT [DEBUG] wire - << "Set-Cookie: >> BIGipServersharepoint_2010_hostname_pool=2760949138.20480.0000; >> path=/[\r][\n]" >> 2013/02/15 18:47:40:373 GMT [DEBUG] wire - << "X-PvInfo: >> [S10201.C11705.A16138.RA0.G0.U349F676B].[OT/html.OG/pages][\r][\n]" >> 2013/02/15 18:47:40:373 GMT [DEBUG] wire - << "Vary: >> Accept-Encoding[\r][\n]" >> 2013/02/15 18:47:40:373 GMT [DEBUG] wire - << "[\r][\n]" >> 2013/02/15 18:47:40:373 GMT [DEBUG] DefaultClientConnection - Receiving >> response: HTTP/1.1 401 Unauthorized >> 2013/02/15 18:47:40:373 GMT [DEBUG] headers - << HTTP/1.1 401 >>Unauthorized >> 2013/02/15 18:47:40:373 GMT [DEBUG] headers - << Connection: keep-alive >> 2013/02/15 18:47:40:373 GMT [DEBUG] headers - << Content-Type: >>text/html; >> charset=utf-8 >> 2013/02/15 18:47:40:373 GMT [DEBUG] headers - << Server: >>Microsoft-IIS/7.5 >> 2013/02/15 18:47:40:373 GMT [DEBUG] headers - << SPRequestGuid: >> 9590ba88-768e-4eb9-a68b-df45b83606d6 >> 2013/02/15 18:47:40:373 GMT [DEBUG] headers - << >>X-SharePointHealthScore: 0 >> 2013/02/15 18:47:40:373 GMT [DEBUG] headers - << WWW-Authenticate: NTLM >> 2013/02/15 18:47:40:373 GMT [DEBUG] headers - << X-Powered-By: ASP.NET >> 2013/02/15 18:47:40:373 GMT [DEBUG] headers - << >> MicrosoftSharePointTeamServices: 14.0.0.6010 >> 2013/02/15 18:47:40:374 GMT [DEBUG] headers - << Date: Fri, 15 Feb 2013 >> 18:47:40 GMT >> 2013/02/15 18:47:40:374 GMT [DEBUG] headers - << Content-Length: 16 >> 2013/02/15 18:47:40:374 GMT [DEBUG] headers - << Set-Cookie: >> BIGipServersharepoint_2010_hostname_pool=2760949138.20480.0000; path=/ >> 2013/02/15 18:47:40:374 GMT [DEBUG] headers - << X-PvInfo: >> [S10201.C11705.A16138.RA0.G0.U349F676B].[OT/html.OG/pages] >> 2013/02/15 18:47:40:374 GMT [DEBUG] headers - << Vary: Accept-Encoding >> 2013/02/15 18:47:40:374 GMT [DEBUG] ResponseProcessCookies - Cookie >> accepted: "[version: 0][name: >> BIGipServersharepoint_2010_hostname_pool][value: >> 2760949138.20480.0000][domain: hostname][path: /][expiry: null]". >> 2013/02/15 18:47:40:374 GMT [DEBUG] DefaultHttpClient - Connection can >>be >> kept alive indefinitely >> 2013/02/15 18:47:40:374 GMT [DEBUG] DefaultHttpClient - Authentication >> required >> 2013/02/15 18:47:40:374 GMT [DEBUG] DefaultHttpClient - hostname:443 >> requested authentication >> 2013/02/15 18:47:40:374 GMT [DEBUG] TargetAuthenticationStrategy - >> Authentication schemes in the order of preference: [negotiate, Kerberos, >> NTLM, Digest, Basic] >> 2013/02/15 18:47:40:374 GMT [DEBUG] TargetAuthenticationStrategy - >> Challenge for negotiate authentication scheme not available >> 2013/02/15 18:47:40:374 GMT [DEBUG] TargetAuthenticationStrategy - >> Challenge for Kerberos authentication scheme not available >> 2013/02/15 18:47:40:374 GMT [DEBUG] TargetAuthenticationStrategy - >> Challenge for Digest authentication scheme not available >> 2013/02/15 18:47:40:374 GMT [DEBUG] TargetAuthenticationStrategy - >> Challenge for Basic authentication scheme not available >> 2013/02/15 18:47:40:374 GMT [DEBUG] DefaultHttpClient - Selected >> authentication options: [NTLM] >> 2013/02/15 18:47:40:374 GMT [DEBUG] wire - << "401 UNAUTHORIZED" >> 2013/02/15 18:47:40:375 GMT [DEBUG] RequestAddCookies - CookieSpec >> selected: best-match >> 2013/02/15 18:47:40:375 GMT [DEBUG] RequestAddCookies - Cookie [version: >> 0][name: BIGipServersharepoint_2010_hostname_pool][value: >> 2760949138.20480.0000][domain: hostname][path: /][expiry: null] match >> [(secure)hostname:443/sites/team-sites/operations/_vti_bin/owssvr.dll] >> 2013/02/15 18:47:40:375 GMT [DEBUG] RequestAuthCache - Auth cache not >>set >> in the context >> 2013/02/15 18:47:40:375 GMT [DEBUG] RequestTargetAuthentication - Target >> auth state: CHALLENGED >> 2013/02/15 18:47:40:375 GMT [DEBUG] RequestTargetAuthentication - >> Generating response to an authentication challenge using ntlm scheme >> 2013/02/15 18:47:40:375 GMT [DEBUG] RequestProxyAuthentication - Proxy >> auth state: UNCHALLENGED >> 2013/02/15 18:47:40:375 GMT [DEBUG] DefaultHttpClient - Attempt 2 to >> execute request >> 2013/02/15 18:47:40:375 GMT [DEBUG] DefaultClientConnection - Sending >> request: GET >> >>/sites/team-sites/operations/_vti_bin/owssvr.dll?Cmd%3DDisplay%26List%3D% >>7B >> 6E460908-D470-4F8A-AF76-CC279E25E0B1%7D%26XMLDATA%3DTRUE HTTP/1.1 >> 2013/02/15 18:47:40:375 GMT [DEBUG] wire - >> "GET >> >>/sites/team-sites/operations/_vti_bin/owssvr.dll?Cmd%3DDisplay%26List%3D% >>7B >> 6E460908-D470-4F8A-AF76-CC279E25E0B1%7D%26XMLDATA%3DTRUE >>HTTP/1.1[\r][\n]" >> 2013/02/15 18:47:40:375 GMT [DEBUG] wire - >> "Host: hostname[\r][\n]" >> 2013/02/15 18:47:40:375 GMT [DEBUG] wire - >> "Connection: >> Keep-Alive[\r][\n]" >> 2013/02/15 18:47:40:375 GMT [DEBUG] wire - >> "User-Agent: >> Apache-HttpClient/4.2.3 (java 1.5)[\r][\n]" >> 2013/02/15 18:47:40:375 GMT [DEBUG] wire - >> "Cookie: >> BIGipServersharepoint_2010_hostname_pool=2760949138.20480.0000[\r][\n]" >> 2013/02/15 18:47:40:375 GMT [DEBUG] wire - >> "Cookie2: >>$Version=1[\r][\n]" >> 2013/02/15 18:47:40:375 GMT [DEBUG] wire - >> "Authorization: NTLM >> xxxxxxx[\r][\n]" >> 2013/02/15 18:47:40:375 GMT [DEBUG] wire - >> "[\r][\n]" >> 2013/02/15 18:47:40:376 GMT [DEBUG] headers - >> GET >> >>/sites/team-sites/operations/_vti_bin/owssvr.dll?Cmd%3DDisplay%26List%3D% >>7B >> 6E460908-D470-4F8A-AF76-CC279E25E0B1%7D%26XMLDATA%3DTRUE HTTP/1.1 >> 2013/02/15 18:47:40:376 GMT [DEBUG] headers - >> Host: hostname >> 2013/02/15 18:47:40:376 GMT [DEBUG] headers - >> Connection: Keep-Alive >> 2013/02/15 18:47:40:376 GMT [DEBUG] headers - >> User-Agent: >> Apache-HttpClient/4.2.3 (java 1.5) >> 2013/02/15 18:47:40:376 GMT [DEBUG] headers - >> Cookie: >> BIGipServersharepoint_2010_hostname_pool=2760949138.20480.0000 >> 2013/02/15 18:47:40:376 GMT [DEBUG] headers - >> Cookie2: $Version=1 >> 2013/02/15 18:47:40:376 GMT [DEBUG] headers - >> Authorization: NTLM >> xxxxxxx >> 2013/02/15 18:47:40:411 GMT [DEBUG] wire - << "HTTP/1.1 401 >> Unauthorized[\r][\n]" >> 2013/02/15 18:47:40:411 GMT [DEBUG] wire - << "Server: >> Microsoft-IIS/7.5[\r][\n]" >> 2013/02/15 18:47:40:411 GMT [DEBUG] wire - << "SPRequestGuid: >> b97ad6a3-1064-4f9d-8ac6-51f7dad0193e[\r][\n]" >> 2013/02/15 18:47:40:411 GMT [DEBUG] wire - << "WWW-Authenticate: NTLM >> xxxxxxx[\r][\n]" >> 2013/02/15 18:47:40:411 GMT [DEBUG] wire - << "X-Powered-By: >> ASP.NET[\r][\n]" >> 2013/02/15 18:47:40:411 GMT [DEBUG] wire - << >> "MicrosoftSharePointTeamServices: 14.0.0.6010[\r][\n]" >> 2013/02/15 18:47:40:411 GMT [DEBUG] wire - << "Date: Fri, 15 Feb 2013 >> 18:47:40 GMT[\r][\n]" >> 2013/02/15 18:47:40:411 GMT [DEBUG] wire - << "Content-Length: >>0[\r][\n]" >> 2013/02/15 18:47:40:412 GMT [DEBUG] wire - << "X-PvInfo: >> [S10201.C11705.A16138.RA16164.G0.U349F676B].[OT/other.OG/other][\r][\n]" >> 2013/02/15 18:47:40:412 GMT [DEBUG] wire - << "[\r][\n]" >> 2013/02/15 18:47:40:412 GMT [DEBUG] DefaultClientConnection - Receiving >> response: HTTP/1.1 401 Unauthorized >> 2013/02/15 18:47:40:412 GMT [DEBUG] headers - << HTTP/1.1 401 >>Unauthorized >> 2013/02/15 18:47:40:412 GMT [DEBUG] headers - << Server: >>Microsoft-IIS/7.5 >> 2013/02/15 18:47:40:412 GMT [DEBUG] headers - << SPRequestGuid: >> b97ad6a3-1064-4f9d-8ac6-51f7dad0193e >> 2013/02/15 18:47:40:412 GMT [DEBUG] headers - << WWW-Authenticate: NTLM >> xxxxxxx >> 2013/02/15 18:47:40:412 GMT [DEBUG] headers - << X-Powered-By: ASP.NET >> 2013/02/15 18:47:40:412 GMT [DEBUG] headers - << >> MicrosoftSharePointTeamServices: 14.0.0.6010 >> 2013/02/15 18:47:40:412 GMT [DEBUG] headers - << Date: Fri, 15 Feb 2013 >> 18:47:40 GMT >> 2013/02/15 18:47:40:412 GMT [DEBUG] headers - << Content-Length: 0 >> 2013/02/15 18:47:40:412 GMT [DEBUG] headers - << X-PvInfo: >> [S10201.C11705.A16138.RA16164.G0.U349F676B].[OT/other.OG/other] >> 2013/02/15 18:47:40:413 GMT [DEBUG] DefaultHttpClient - Connection can >>be >> kept alive indefinitely >> 2013/02/15 18:47:40:413 GMT [DEBUG] DefaultHttpClient - Authentication >> required >> 2013/02/15 18:47:40:413 GMT [DEBUG] DefaultHttpClient - hostname:443 >> requested authentication >> 2013/02/15 18:47:40:413 GMT [DEBUG] DefaultHttpClient - Authorization >> challenge processed >> 2013/02/15 18:47:40:413 GMT [DEBUG] RequestAddCookies - CookieSpec >> selected: best-match >> 2013/02/15 18:47:40:413 GMT [DEBUG] RequestAddCookies - Cookie [version: >> 0][name: BIGipServersharepoint_2010_hostname_pool][value: >> 2760949138.20480.0000][domain: hostname][path: /][expiry: null] match >> [(secure)hostname:443/sites/team-sites/operations/_vti_bin/owssvr.dll] >> 2013/02/15 18:47:40:413 GMT [DEBUG] RequestAuthCache - Auth cache not >>set >> in the context >> 2013/02/15 18:47:40:413 GMT [DEBUG] RequestTargetAuthentication - Target >> auth state: HANDSHAKE >> 2013/02/15 18:47:40:415 GMT [DEBUG] RequestProxyAuthentication - Proxy >> auth state: UNCHALLENGED >> 2013/02/15 18:47:40:415 GMT [DEBUG] DefaultHttpClient - Attempt 3 to >> execute request >> 2013/02/15 18:47:40:415 GMT [DEBUG] DefaultClientConnection - Sending >> request: GET >> >>/sites/team-sites/operations/_vti_bin/owssvr.dll?Cmd%3DDisplay%26List%3D% >>7B >> 6E460908-D470-4F8A-AF76-CC279E25E0B1%7D%26XMLDATA%3DTRUE HTTP/1.1 >> 2013/02/15 18:47:40:416 GMT [DEBUG] wire - >> "GET >> >>/sites/team-sites/operations/_vti_bin/owssvr.dll?Cmd%3DDisplay%26List%3D% >>7B >> 6E460908-D470-4F8A-AF76-CC279E25E0B1%7D%26XMLDATA%3DTRUE >>HTTP/1.1[\r][\n]" >> 2013/02/15 18:47:40:416 GMT [DEBUG] wire - >> "Host: hostname[\r][\n]" >> 2013/02/15 18:47:40:416 GMT [DEBUG] wire - >> "Connection: >> Keep-Alive[\r][\n]" >> 2013/02/15 18:47:40:416 GMT [DEBUG] wire - >> "User-Agent: >> Apache-HttpClient/4.2.3 (java 1.5)[\r][\n]" >> 2013/02/15 18:47:40:416 GMT [DEBUG] wire - >> "Cookie: >> BIGipServersharepoint_2010_hostname_pool=2760949138.20480.0000[\r][\n]" >> 2013/02/15 18:47:40:416 GMT [DEBUG] wire - >> "Cookie2: >>$Version=1[\r][\n]" >> 2013/02/15 18:47:40:416 GMT [DEBUG] wire - >> "Authorization: NTLM >> xxxxxxx[\r][\n]" >> 2013/02/15 18:47:40:416 GMT [DEBUG] wire - >> "[\r][\n]" >> 2013/02/15 18:47:40:416 GMT [DEBUG] headers - >> GET >> >>/sites/team-sites/operations/_vti_bin/owssvr.dll?Cmd%3DDisplay%26List%3D% >>7B >> 6E460908-D470-4F8A-AF76-CC279E25E0B1%7D%26XMLDATA%3DTRUE HTTP/1.1 >> 2013/02/15 18:47:40:416 GMT [DEBUG] headers - >> Host: hostname >> 2013/02/15 18:47:40:416 GMT [DEBUG] headers - >> Connection: Keep-Alive >> 2013/02/15 18:47:40:417 GMT [DEBUG] headers - >> User-Agent: >> Apache-HttpClient/4.2.3 (java 1.5) >> 2013/02/15 18:47:40:417 GMT [DEBUG] headers - >> Cookie: >> BIGipServersharepoint_2010_hostname_pool=2760949138.20480.0000 >> 2013/02/15 18:47:40:417 GMT [DEBUG] headers - >> Cookie2: $Version=1 >> 2013/02/15 18:47:40:417 GMT [DEBUG] headers - >> Authorization: NTLM >> xxxxxxx >> 2013/02/15 18:47:40:460 GMT [DEBUG] wire - << "HTTP/1.1 401 >> Unauthorized[\r][\n]" >> 2013/02/15 18:47:40:460 GMT [DEBUG] wire - << "Server: >> Microsoft-IIS/7.5[\r][\n]" >> 2013/02/15 18:47:40:460 GMT [DEBUG] wire - << "SPRequestGuid: >> 540b78fa-17b9-47b3-bafc-e351f8cc357b[\r][\n]" >> 2013/02/15 18:47:40:460 GMT [DEBUG] wire - << "WWW-Authenticate: >> NTLM[\r][\n]" >> 2013/02/15 18:47:40:460 GMT [DEBUG] wire - << "X-Powered-By: >> ASP.NET[\r][\n]" >> 2013/02/15 18:47:40:460 GMT [DEBUG] wire - << >> "MicrosoftSharePointTeamServices: 14.0.0.6010[\r][\n]" >> 2013/02/15 18:47:40:460 GMT [DEBUG] wire - << "Date: Fri, 15 Feb 2013 >> 18:47:40 GMT[\r][\n]" >> 2013/02/15 18:47:40:460 GMT [DEBUG] wire - << "Content-Length: >>0[\r][\n]" >> 2013/02/15 18:47:40:460 GMT [DEBUG] wire - << "X-PvInfo: >> [S10201.C11705.A16138.RA16164.G0.U349F676B].[OT/other.OG/other][\r][\n]" >> 2013/02/15 18:47:40:460 GMT [DEBUG] wire - << "[\r][\n]" >> 2013/02/15 18:47:40:460 GMT [DEBUG] DefaultClientConnection - Receiving >> response: HTTP/1.1 401 Unauthorized >> 2013/02/15 18:47:40:460 GMT [DEBUG] headers - << HTTP/1.1 401 >>Unauthorized >> 2013/02/15 18:47:40:460 GMT [DEBUG] headers - << Server: >>Microsoft-IIS/7.5 >> 2013/02/15 18:47:40:460 GMT [DEBUG] headers - << SPRequestGuid: >> 540b78fa-17b9-47b3-bafc-e351f8cc357b >> 2013/02/15 18:47:40:460 GMT [DEBUG] headers - << WWW-Authenticate: NTLM >> 2013/02/15 18:47:40:460 GMT [DEBUG] headers - << X-Powered-By: ASP.NET >> 2013/02/15 18:47:40:461 GMT [DEBUG] headers - << >> MicrosoftSharePointTeamServices: 14.0.0.6010 >> 2013/02/15 18:47:40:461 GMT [DEBUG] headers - << Date: Fri, 15 Feb 2013 >> 18:47:40 GMT >> 2013/02/15 18:47:40:461 GMT [DEBUG] headers - << Content-Length: 0 >> 2013/02/15 18:47:40:461 GMT [DEBUG] headers - << X-PvInfo: >> [S10201.C11705.A16138.RA16164.G0.U349F676B].[OT/other.OG/other] >> 2013/02/15 18:47:40:461 GMT [DEBUG] DefaultHttpClient - Connection can >>be >> kept alive indefinitely >> 2013/02/15 18:47:40:461 GMT [DEBUG] DefaultHttpClient - Authentication >> required >> 2013/02/15 18:47:40:461 GMT [DEBUG] DefaultHttpClient - hostname:443 >> requested authentication >> 2013/02/15 18:47:40:461 GMT [DEBUG] DefaultHttpClient - Authorization >> challenge processed >> 2013/02/15 18:47:40:461 GMT [DEBUG] DefaultHttpClient - Authentication >> failed >> ---------------------------------------- >> HTTP/1.1 401 Unauthorized >> HTTP/1.1 >> Response content length: 0 >> 2013/02/15 18:47:40:461 GMT [DEBUG] BasicClientConnectionManager - >> Releasing connection >> org.apache.http.impl.conn.ManagedClientConnectionImpl@2c72bd07 >> 2013/02/15 18:47:40:461 GMT [DEBUG] BasicClientConnectionManager - >> Connection can be kept alive indefinitely >> 2013/02/15 18:47:40:462 GMT [DEBUG] DefaultClientConnection - Connection >> 0.0.0.0:55851<->146.189.217.28:443 closed >> >> >> >> On 2/15/13 1:47 PM, "Oleg Kalnichevski" <ol...@apache.org> wrote: >> >> >On Fri, 2013-02-15 at 11:55 -0500, Chawla, Vanita wrote: >> >> I am trying to use a REST call to Sharepoint 2010 via HTTPClient >>4.2.3 >> >> from a java Liferay 6.1 portlet on Mac OS 10.6.x (snow leopard). >> >> The response I always get back is: HTTP/1.1 401 Unauthorized >> >> >> >> I don't see an SSL handshake in the wire logs, but see a cookie and >>get >> >>a >> >> 401 unauthorized response. I have tried various combinations of the >> >>sample >> >> codes with same results. >> >> >> >> I have imported the cert into my local MAC's JVM cacerts and am >>trying >> >>to >> >> load the cacerts as the keystore. >> >> >> >> Note - that I've used FireFox and CURL to do the same thing I'm >>trying >> >>to >> >> do here programmatically, and it works fine. So the server appears >>to be >> >> set up correctly. The CURL verbose log show the SSL handshake >>happening >> >> first and the NTLM succeeds as the next step. >> >> My code is: >> >> >> >> String opsCalendarURL1 = >> >> "https://hostname/sites/team-sites/operations/_vti_bin/owssvr.dll?"; >> >> String opsCalendarURL2 = >> >> >>"Cmd=Display&List={6E460908-D470-4F8A-AF76-CC279E25E0B1}&XMLDATA=TRUE"; >> >> String opsCalenderURLEncoded = opsCalendarURL1 + URLEncoder.encode( >> >> opsCalendarURL2 , "UTF8" ); >> >> >> >> System.out.println(opsCalenderURLEncoded); >> >> DefaultHttpClient httpclient = new DefaultHttpClient(); >> >> >> >> try { >> >> // SSL >> >> KeyStore trustStore = >> >>KeyStore.getInstance(KeyStore.getDefaultType()); >> >> FileInputStream instream = new FileInputStream(new >> >> >> >>>>File("/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/ >>>>li >> >>b/ >> >> security/cacerts")); >> >> try { >> >> trustStore.load(instream, "pwd".toCharArray()); >> >> } finally { >> >> try { instream.close(); } catch (Exception ignore) {} >> >> } >> >> >> >> SSLSocketFactory socketFactory = new SSLSocketFactory(trustStore); >> >> Scheme sch = new Scheme("https", 443, socketFactory); >> >> >>httpclient.getConnectionManager().getSchemeRegistry().register(sch); >> >> System.out.println("----------------------------------------"); >> >> >> >> HttpHost targetHost = new HttpHost("hostname", 443, "https"); >> >> httpclient.getCredentialsProvider().setCredentials( >> >> AuthScope.ANY, >> >> new NTCredentials("username", "password","machine","domain")); >> >> >> >> HttpGet httpget = new HttpGet(opsCalenderURLEncoded); >> >> >> >> System.out.println("executing request: " + >>httpget.getRequestLine()); >> >> System.out.println("to target: " + targetHost); >> >> >> >> HttpResponse response2 = httpclient.execute(targetHost, httpget); >> >> HttpEntity entity = response2.getEntity(); >> >> >> >> System.out.println("----------------------------------------"); >> >> System.out.println(response2.getStatusLine()); >> >> System.out.println(response2.getProtocolVersion()); >> >> if (entity != null) { >> >> System.out.println("Response content length: " + >> >> entity.getContentLength()); >> >> } >> >> EntityUtils.consume(entity); >> >> } finally { >> >> httpclient.getConnectionManager().shutdown(); >> >> } >> >> >> >> I can attach the wire logs if needed. >> >> >> > >> >Post wire logs. >> > >> >Oleg >> > >> > >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org >> For additional commands, e-mail: httpclient-users-h...@hc.apache.org >> > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org >For additional commands, e-mail: httpclient-users-h...@hc.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org