hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julius Davies" <juliusdav...@gmail.com>
Subject Re: No private keys found in keystore
Date Sat, 28 Jun 2008 00:08:44 GMT
Not an httpclient issue.  This is a not-yet-common-ssl issue.  What
version of "not-yet-commons-ssl" are you on?

yours,

Julius


On Fri, Jun 27, 2008 at 4:25 PM, Alessandro Vernet <avernet@scdi.org> wrote:
>
> I am using AuthSSLProtocolSocketFactory as I need to sent my client
> certificate when talking to server. I do this with the following code:
>
> Protocol authhttps = new Protocol("https",
>        (ProtocolSocketFactory) new AuthSSLProtocolSocketFactory(
>                new URL("file:///path/to/keystore"), "importkey",
>                new URL("file:///path/to/truststore"), "importkey"), 443);
> Protocol.registerProtocol("https", authhttps);
> HttpClient client = new HttpClient();
> GetMethod fileGet = new GetMethod("https://server/path");
> int status = client.executeMethod(fileGet);
>
> This gives me the following exception:
>
> Exception in thread "main" java.security.KeyStoreException: No private keys
> found in keystore!
>        at
> org.apache.commons.ssl.KeyStoreBuilder.validate(KeyStoreBuilder.java:269)
>        at org.apache.commons.ssl.KeyStoreBuilder.build(KeyStoreBuilder.java:129)
>        at org.apache.commons.ssl.KeyMaterial.<init>(KeyMaterial.java:179)
>        at org.apache.commons.ssl.KeyMaterial.<init>(KeyMaterial.java:170)
>        at org.apache.commons.ssl.KeyMaterial.<init>(KeyMaterial.java:160)
>        at org.apache.commons.ssl.KeyMaterial.<init>(KeyMaterial.java:64)
>        at org.apache.commons.ssl.KeyMaterial.<init>(KeyMaterial.java:139)
>        at
> org.apache.commons.httpclient.contrib.ssl.AuthSSLProtocolSocketFactory.<init>(AuthSSLProtocolSocketFactory.java:191)
>
> But the key store I am pointing to does contain a key. This is what I get
> when running "keytool -list -keystore keystore":
>
> Keystore type: jks
> Keystore provider: SUN
>
> Your keystore contains 1 entry
>
> importkey, Jun 26, 2008, keyEntry,
> Certificate fingerprint (MD5):
> 75:62:FE:32:9F:CE:5F:12:8D:26:CC:02:06:B8:35:B2
>
> Any idea on why I could be getting this exception?
>
> Alex
>



-- 
yours,

Julius Davies
250-592-2284 (Home)
250-893-4579 (Mobile)
http://juliusdavies.ca/

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message