public HttpClient createHttpClient(
			ClientConfiguration paramClientConfiguration) {
		BasicHttpParams localBasicHttpParams = new BasicHttpParams();
		HttpProtocolParams.setUserAgent(localBasicHttpParams,
				paramClientConfiguration.getUserAgent());
		HttpProtocolParams.setVersion(localBasicHttpParams,
				HttpVersion.HTTP_1_1);
		HttpConnectionParams.setConnectionTimeout(localBasicHttpParams,
				paramClientConfiguration.getConnectionTimeout());
		HttpConnectionParams.setSoTimeout(localBasicHttpParams,
				paramClientConfiguration.getSocketTimeout());
		HttpConnectionParams
				.setStaleCheckingEnabled(localBasicHttpParams, true);
		HttpConnectionParams.setTcpNoDelay(localBasicHttpParams, true);

		int i = paramClientConfiguration.getSocketBufferSizeHints()[0];
		int j = paramClientConfiguration.getSocketBufferSizeHints()[1];
		if ((i > 0) || (j > 0)) {
			HttpConnectionParams.setSocketBufferSize(localBasicHttpParams,
					Math.max(i, j));
		}

		SchemeRegistry localSchemeRegistry = new SchemeRegistry();

		localSchemeRegistry.register(new Scheme("http", PlainSocketFactory
				.getSocketFactory(), 80));
		try {
			KeyStore localKeyStore = KeyStore.getInstance(KeyStore
					.getDefaultType());
			localKeyStore.load(null, null);
			localSchemeRegistry.register(new Scheme("https",
					new TrustAllSSLSocketFactory(localKeyStore), 443));
		} catch (Exception localException) {
			throw new BCSClientException("Can not enable ssl.", localException);
		}

		ConnManagerParams.setMaxTotalConnections(localBasicHttpParams,
				paramClientConfiguration.getMaxConnections());
		ConnManagerParams.setMaxConnectionsPerRoute(
				localBasicHttpParams,
				new ConnPerRouteBean(paramClientConfiguration
						.getMaxConnectionsPerRoute()));
		ThreadSafeClientConnManager localThreadSafeClientConnManager = new ThreadSafeClientConnManager(
				localBasicHttpParams, localSchemeRegistry);

		DefaultHttpClient localDefaultHttpClient = new DefaultHttpClient(
				localThreadSafeClientConnManager, localBasicHttpParams);

		String str1 = paramClientConfiguration.getProxyHost();
		int k = paramClientConfiguration.getProxyPort();
		if ((str1 != null) && (k > 0)) {
			HttpHost localHttpHost = new HttpHost(str1, k);
			localDefaultHttpClient.getParams().setParameter(
					"http.route.default-proxy", localHttpHost);

			String str2 = paramClientConfiguration.getProxyUsername();
			String str3 = paramClientConfiguration.getProxyPassword();
			String str4 = paramClientConfiguration.getProxyDomain();
			String str5 = paramClientConfiguration.getProxyWorkstation();

			if ((str2 != null) && (str3 != null)) {
				localDefaultHttpClient.getCredentialsProvider().setCredentials(
						new AuthScope(str1, k),
						new NTCredentials(str2, str3, str5, str4));
			}

		}

		return localDefaultHttpClient;
	}