hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Valentin Popov <valentin...@gmail.com>
Subject Re: NTLM authentication using JCIFS with HttpClient 3.1
Date Fri, 30 Oct 2009 13:49:59 GMT
private HttpClient newClient(String uri, int hostConnectionNumber)  
throws HttpException, IOException{
			
	    	Protocol.registerProtocol("https", new Protocol("https",  
(ProtocolSocketFactory) new EasySSLProtocolSocketFactory(), 443));
			
			
			HostConfiguration hostConfig = new HostConfiguration();
		    hostConfig.setHost(uri);
		
		    HttpConnectionManager connectionManager = new  
MultiThreadedHttpConnectionManager();
		    HttpConnectionManagerParams params = new  
HttpConnectionManagerParams();
		    int maxHostConnections = hostConnectionNumber;
		    params.setMaxConnectionsPerHost(hostConfig, maxHostConnections);
		    connectionManager.setParams(params);
		
		    HttpClient client = new HttpClient(connectionManager);
		    client.getHostConfiguration().setHost("smallbusiness.local", 80,  
"http");
		    client.getParams().setCookiePolicy 
(CookiePolicy.BROWSER_COMPATIBILITY);
		    client.setHostConfiguration(hostConfig);
		    Credentials creds = new NTCredentials 
(ExchangeStubbingWD.adminName, ExchangeStubbingWD.adminPassword,  
ExchangeStubbingWD.serverIP, ExchangeStubbingWD.domainName);
		    client.getState().setCredentials(AuthScope.ANY, creds);
		
		    return client;
			
		}

Regards
Valentin





30.10.2009, в 16:47, arpita dhundia написал(а):

>
> Hello people,
>
> I am running into an issue using NTLM authentication with commons  
> HttpClient 3.1. I have tried using JCIFS lib with HttpClient 4.0 for  
> ntlm authentication and its works well.
> But now I am trying to use JCIFS with commons HttpClient 3.1 API..  
> Any idea how can I do that?
>
> Thanks,
> Arpita
>
>
>
>      Try the new Yahoo! India Homepage. Click here. http://in.yahoo.com/trynew


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