public KeyStore getKeyStore(){

    	SchemeRegistry registry = httpClient4.getConnectionManager().getSchemeRegistry();

    	if(! registry.getSchemeNames().contains("https")){
    		throw new IllegalStateException("Registry does not include an 'https' entry.");
    	}

    	SchemeSocketFactory awareSocketFactory = httpClient4.getConnectionManager().getSchemeRegistry().getScheme("https").getSchemeSocketFactory();

    	if(awareSocketFactory instanceof KeyStoreAwareSocketFactory){
    		return ((KeyStoreAwareSocketFactory) awareSocketFactory).getKeyStore();
    	}else{
    		throw new IllegalStateException("Cannot extract keystore from scheme socket factory of type: " + awareSocketFactory.getClass().getName());
    	}
    }
A client that is essentially a wrapper around Jersey client. By default, it uses HttpClient for underlying HTTP communication.
Application can set its own Jersey client with this class, but doing so will void all client configurations set in {@link IClientConfig}.

@deprecated Please see ribbon-rxnetty module for the Netty based client. 

@author awang
ribbon-httpclient/src/main/java/com/netflix/niws/client/http/RestClient.java