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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]