/** * Gets the default factory. * * @return the default factory */ public static PlainSocketFactory getSocketFactory() { return new PlainSocketFactory(); }
/** * Gets the default factory. * * @return the default factory */ public static PlainSocketFactory getSocketFactory() { return new PlainSocketFactory(); }
/** * Gets the default factory. * * @return the default factory */ public static PlainSocketFactory getSocketFactory() { return new PlainSocketFactory(); }
/** * Gets the default factory. * * @return the default factory */ public static PlainSocketFactory getSocketFactory() { return new PlainSocketFactory(); }
protected HttpClient constructClient() { HttpParams params = new BasicHttpParams(); params.setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1); // use the debug proxy to view internet traffic on the host computer if (ABCApplication.isDebuggingProxy()) params.setParameter(ConnRoutePNames.DEFAULT_PROXY, new HttpHost(ABCConstants.DEBUG_PROXY_HOST, ABCConstants.DEBUG_PROXY_PORT, "http")); // ignore ssl certification (due to signed authority not appearing on android list of permitted authorities) // see: http://blog.antoine.li/2010/10/22/android-trusting-ssl-certificates/ SchemeRegistry registry = new SchemeRegistry(); registry.register(new Scheme("http", new PlainSocketFactory(), 80)); registry.register(new Scheme("https", new FakeSocketFactory(), 443)); ClientConnectionManager cm = new SingleClientConnManager(params, registry); return new DefaultHttpClient(cm, params); }
//In class XMLRPCClient public XMLRPCClient(URI uri) { SchemeRegistry registry = new SchemeRegistry(); registry.register(new Scheme("http", new PlainSocketFactory(), 80)); registry.register(new Scheme("https", new EasySSLSocketFactory(), 443)); postMethod = new HttpPost(uri); postMethod.addHeader("Content-Type", "text/xml"); // WARNING // I had to disable "Expect: 100-Continue" header since I had // two second delay between sending http POST request and POST body httpParams = postMethod.getParams(); HttpProtocolParams.setUseExpectContinue(httpParams, false); this .client = new DefaultHttpClient( new ThreadSafeClientConnManager(httpParams, registry), httpParams); }
public static ClientConnectionManager newConnectionManager( SslConfig sslConfig ) { SchemeRegistry schemeReg = new SchemeRegistry(); schemeReg.register( new Scheme( "http", 80, new PlainSocketFactory() ) ); schemeReg.register( new Scheme( "https", 443, new SslSocketFactory( sslConfig ) ) ); PoolingClientConnectionManager connMgr = new PoolingClientConnectionManager( schemeReg ); connMgr.setMaxTotal( 100 ); connMgr.setDefaultMaxPerRoute( 50 ); return connMgr; }
public static DefaultHttpClient buildDefaultSearchHttpClient(boolean ignoreSslIssues) { SchemeRegistry registry = new SchemeRegistry(); registry.register(new Scheme("http", new PlainSocketFactory(), 80)); registry.register(new Scheme("https", ignoreSslIssues ? new IgnoreTlsSniSocketFactory() : new TlsSniSocketFactory(), 443)); HttpParams httpparams = new BasicHttpParams(); HttpConnectionParams.setConnectionTimeout(httpparams, 8000); HttpConnectionParams.setSoTimeout(httpparams, 8000); DefaultHttpClient httpclient = new DefaultHttpClient(new ThreadSafeClientConnManager(httpparams, registry), httpparams); httpclient.addRequestInterceptor(HttpHelper.gzipRequestInterceptor); httpclient.addResponseInterceptor(HttpHelper.gzipResponseInterceptor); return httpclient; }
SchemeRegistry schemeRegistry = new SchemeRegistry(); schemeRegistry.register(new Scheme("https", 443, sslSocketFactory)); schemeRegistry.register(new Scheme("http", 80, new PlainSocketFactory()));