hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patruni Satish" <patrunisat...@gmail.com>
Subject AuthSSLProtocolSocketFactory Error
Date Mon, 22 Oct 2007 16:37:05 GMT
Hello All,
I am trying use Client Based Authentication from a Apache HttpClient
to a secure server. I recieve an error
java.net.SocketException: Software caused connection abort: recv failed

Environment Details:
server and client are both windows XP.
Server version: Apache/2.2.6 (Win32)
Server built:   Sep  5 2007 08:58:56
OpenSSL 0.9.8d 28 Sep 2006

I have installed Apache, created a local CA, created a certificate,
configured Apache to use the certificate as the server cert.
Imported the same certificate & key in PKCS12 format to IE to be used
client certificate.
Open the URL in the browser, the certificate window pops up and I can
reach to the "It Works!!" page.

openssl s_client works fine when I try to reach the URL providing the
certificate details, I can reach the "It Works!!" page.

For my java client, I did the following:
1. Imported the certficate & key to a keystore. I use the same
keystore as the truststore and keystore(I read it somewhere that I can
do it).
2. Added the cacert.pem file to the cacerts(both the C:\documents and

Now i use the AuthSSLProtocolFactory as below:

HttpClient tempClient = new HttpClient();
AuthSSLProtocolSocketFactory myAuthFactory = new
AuthSSLProtocolSocketFactory(new URL("file:" +
URL("file:" + "C:/Software/CodeSigning/CA-Openssl-0.9.8d-Win32/forApache/client.keystore"),"123456");
        Protocol myhttps = new Protocol("https",myAuthFactory,443);
        Protocol.registerProtocol("https", myhttps);
        tempClient.getHostConfiguration().setHost("localhost", 443, myhttps);
        GetMethod getMethodObj = new GetMethod("/");

All I get to see is the error above.. please let me know where I am
going wrong..

Thanks & Regards,
Satish Patruni.

To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org

View raw message