You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Adrián Roselló Rey <ad...@i2cat.net> on 2014/09/12 14:04:57 UTC

x509 certificates and JAX-RS

Hi!

Some months ago I used JAXRSClientFactoryBean to programatically create a
REST client for a remote application. Please find the code to create the
client:












*       ProxyClassLoader classLoader = new ProxyClassLoader();
classLoader.addLoader(apiClass.getClassLoader());
classLoader.addLoader(JAXRSClientFactoryBean.class.getClassLoader());
    JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
bean.setAddress(address);        bean.setResourceClass(MyClass.class);
    bean.setClassLoader(classLoader);        return
bean.create(MyClass.class);*


I can't use my client any more, since security module has been implemented
in the server side. It's based in x509 certificates.

The curl command looks like this:

*curl --cert my_cer.pem --key user_cer.pkey .....*

How do I configure the client to use such authentication type? How do I
integrate the user certificate in the request?

Thanks a lot!

All the best,

Adrián Roselló Rey

-- 




*Adrián Roselló Rey Distributed Applications and Networks Area (DANA) i2CAT
Foundation, Barcelona, Spain*
T: +34 93 553 25 49
http://dana.i2cat.net

Re: x509 certificates and JAX-RS

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

You can use CXF HttpConduit to set up the client certs, please check the 
archives there are many examples of it, or try JAXRS 2.0 Client API, it 
allows setting the client certs using the standard API

HTH, Sergey
On 12/09/14 13:04, Adrián Roselló Rey wrote:
> Hi!
>
> Some months ago I used JAXRSClientFactoryBean to programatically create a
> REST client for a remote application. Please find the code to create the
> client:
>
>
>
>
>
>
>
>
>
>
>
>
> *       ProxyClassLoader classLoader = new ProxyClassLoader();
> classLoader.addLoader(apiClass.getClassLoader());
> classLoader.addLoader(JAXRSClientFactoryBean.class.getClassLoader());
>      JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
> bean.setAddress(address);        bean.setResourceClass(MyClass.class);
>      bean.setClassLoader(classLoader);        return
> bean.create(MyClass.class);*
>
>
> I can't use my client any more, since security module has been implemented
> in the server side. It's based in x509 certificates.
>
> The curl command looks like this:
>
> *curl --cert my_cer.pem --key user_cer.pkey .....*
>
> How do I configure the client to use such authentication type? How do I
> integrate the user certificate in the request?
>
> Thanks a lot!
>
> All the best,
>
> Adrián Roselló Rey
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com