hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sachin Nikumbh <saniku...@gmail.com>
Subject HTTP async client and accessing server certificate (SSL)
Date Mon, 29 Apr 2013 15:27:04 GMT

I am currently using the HTTP async client in my application to communicate
with a proprietary server. Now, I need to extend the functionality to
include HTTPS support. We need to provide client authentication and I have
the following picture of how I can provide client credentials.

My first question is, is this the correct approach? Am I missing anything


SSLContext context = ..... ; // Create with user provided

AsyncScheme scheme = new AsyncScheme( "https", 9910, new
SSLLayeringStrategy(context) );

HttpAsyncClient httpClientAsync = new DefaultHttpAsyncClient();

PoolingClientAsyncConnectionManager connectionMgr =

AsyncSchemeRegistry asyncReg = connectionMgr.getSchemeRegistry();


My second question is about server authorization for which I need access to
the server certificate. I need to get the CN value from the certificate
which I am later going to use internally. I am basically looking for
something similar to java.net.HttpsUrlConnection.getPeerPrincipal or

Any help will be greatly appreciated.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message