Tim Wild wrote:

Hi all,

Using a link to Sun code that a few people have posted before, I have client authentication working using HttpClient by creating my own SecureProtocolSocketFactory.

The problem i'm having is that it seems to automatically choose a certificate without asking me which one to use. Does anyone know how to modify the following code to retrieve a cert by name?

I came across that same problem before.

My answer is: You don't.
If you have multiple client certificates, what you should do is combine all of them into one keystore.
PKCS12 only allows you to have one, so you have to put all your PKCS12 certificates into a JKS keystore.


And then, you dont have to do the code that you showed earlier.
All you have to do is specify your JKS keystore filename via the system property java.net.ssl.keyStore
and the passphrase for the keystore via java.net.ssl.keyStorePassword
and then specify that JKS for the property java.net.ssl.keyStoreType


Even a way to work out which client cert is loaded would be great.

Thanks

Tim





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to