Code example for PlainSocketFactory

		HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
		//ClientConnectionManager cm = new ThreadSafeClientConnManager(params, schemeRegistry); 
	    SchemeRegistry registry = new SchemeRegistry();
	    registry.register(new Scheme("http", new PlainSocketFactory(), 80)); 
	    registry.register(new Scheme("https", (trustAll  ? EasySSLSocketFactory.getSocketFactory(): SSLSocketFactory.getSocketFactory()), 443));
	    DefaultHttpClient client = new DefaultHttpClient(new ThreadSafeClientConnManager(params, registry), params);
	       return client;
	public CaldavFacade(String mUser, String mPassword, String mURL) throws MalformedURLException  {
		url = new URL(mURL);
		httpClient = getHttpClient();
	    UsernamePasswordCredentials upc = new UsernamePasswordCredentials(mUser, mPassword);
	   AuthScope as = new AuthScope(url.getHost(), -1);
Connect your IDE to all the code out there  Get Codota for Java