Hi all!
I'm having some problems with SSL and JAX-RS clients. I create JAX-RS
clients programatically with the JAXRSClientFactoryBean like this;
* 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);*
When I test my client doing a request to the real server, I receive
following exception
j
*Caused by: java.io.IOException: IOException invoking
https://83.212.32.165:8001/resources/lease
<https://83.212.32.165:8001/resources/lease>: The https URL hostname does
not match the Common Name (CN) on the server certificate in the client's
truststore. Make sure server certificate is correct, or to disable this
check (NOT recommended for production) set the CXF client TLS configuration
property "disableCNCheck" to true. at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
....*
For a first approach, I just want to disable CN check as mentioned, but I I
haven't seen how do it programatically. Is there any way to do that?
Thanks!
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