views:

121

answers:

2

Hi all,

I have a Java CXF client that connects to a SSL secured Web Service with mutual authentication. I have my keystore and my truststore properly configured on the client-side and it works fine.

I am concerned here by the fact that my keystore contains only one client certificate and on the CXF configuration it is not possible to say "ok for this SSL communication you'll use this certificate".
As I only have one certificate it's not difficult to choose the good one for CXF durign SSL handshake. But this client will be deployed in a environment where it will be used with multiple possible client having their own certificate and each of them will be signed by the same certification authority. When the server will ask for a client certificate that is signed by a specific authority, there will be no way to distinguish one certificate from another.
How can I tell CXF (or Java) to use the proper certificate in this context?

Do I need to build as many SSL context as client certificates? (ie. having N keystore each of them containing only one certificate). Or is there a way (in CXF conf or in Java) to say "use this certificate in this context"?

Thanks in advance for your help.

A: 

All the certificates must refer to the same client, otherwise the CAs are derelect in their duty. So they should all have for example the same subjectX500Principal. So why do you need a specific certificate? All of them identify the same client, so from an authentication point of view they are all equivalent.

It's starting to sound as though you want to use a particular certificate for authorization purposes, not just to establish identity via authentication. If so it is the wrong approach, a misuse of PKI. Authorization is an application-controlled step once you have an authenticated identity: get the identity of of the peer certificate and look up your authorization database to see if that identity is allowed to access this part of the application. Don't try to use a cacerts file as an authorization database, that's not what it's for.

EJP
Thanks for your response.I agree with you, I have to make a difference between both authentication and authorization. The authentication is provided by SSL and the authorization will be provided by WS-Security and SAML tokens in the SOAP.
reef
A: 

I don't know if this is an option for you but I've done dynamic alias selection using WSIT before (i.e. one keystore, many private key entries). See this article for more detail. (Let me know if that article isn't enough - I can post more detail if you need)

Catchwa
Thanks for this link. I don't know yet if this fits my needs I will take a look for sure to this certificate selection functionnality.Thanks!
reef