Code example for SchemeRegistry

Methods: register

0
 */ 
public class SslHttpClient extends DefaultHttpClient {
 
    @Override 
    protected ClientConnectionManager createClientConnectionManager() {
        SchemeRegistry schemeRegistry = new SchemeRegistry();
//        schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80)); 
        schemeRegistry.register(new Scheme("https", new SslSocketFactory(), 443));
        final ClientConnectionManager clientConnectionManager = new ThreadSafeClientConnManager(new BasicHttpParams(), schemeRegistry);
        return clientConnectionManager;
    } 
} 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE