Camel-jetty 2 way ssl authentication

Posted on

Hello,

I'm trying to make a 2 way ssl authentication from my laptop to a server where i have Fuse 7.5 and where i publish a route with a camel-jetty endpoint:

sslContext :

<camel:sslContextParameters id="ssl">

-- server ssl private key and certificate
<camel:keyManagers keyPassword="pwd">

<camel:keyStore type="PKCS12" resource="/opt/server.p12"

password="pwd" />

</camel:keyManagers>

--- We require client to authenticate
<camel:serverParameters clientAuthentication="REQUIRE"/>

-- Trustmanager

<camel:trustManagers>
<camel:keyStore resource="/opt/client.p12"
type="PKCS12" password="pwd1" />

</camel:trustManagers>
</camel:sslContextParameters>


The route : 
<route>

 <from uri="jetty:
https://0.0.0.0:8443/test/gateway&amp;sslContextParameters=#ssl"/>

<to uri="http://...."/>
</route>

The route is working fine without client authentication, but when i add the client auth part, and try from java client or a browser (even after adding client.p12 to the browser), i have errors like

certificate unkown or bad certificate

The server certificate is a signed one ..the one in my laptop is self signed..

The file client.p12 was generated from the self signed certificate on my laptop like this:

openssl pkcs12 -export -out client.p12 -inkey client.key -in client.crt

Is this the right way to set the truststore?

Is the error occuring because the client certificate is self signed ?

What i m doing wrong ?

Do u have a working example to provide ?

Many thanks

Responses