Hi

I haven't tried configurinh HTTPS from the code yet, but given [1]

it will probably look something like this:

WebClient wc = WebClient.create(address);
HttpConduit conduit = WebClient.getClient(wc).getConfig().getHttpConduit();
TLSClientParameters params = conduit.getTlsClientParameters();

and then set relevant properties as per [1].
I will add a test later on, can't do today

Cheers, Sergey

[1] http://cxf.apache.org/javadoc/latest/org/apache/cxf/configuration/jsse/TLSClientParameters.html


On 24/10/11 22:43, sdoca sdoca wrote:
Hi,

I have written Jersey RESTful clients that made use of a Dumb X509TrustManager 
and a HostnameVerifier to trust all SSL certs on our lab systems to make it 
easier to deal with certs that are self-signed.

         ClientConfig config = new DefaultClientConfig();
         SSLContext context = null;
         try
         {
             context = SSLContext.getInstance("SSL");
             context.init(null,
                     new TrustManager[] { new DumbX509TrustManager() },
                     null);
             config.getProperties()
                     .put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES,
                             new HTTPSProperties(this.getHostnameVerifier(),
                                     context));
             webClient = Client.create(config);
         }
         ....

Is there a way for me to do something similar using CXF?

Thanks!

(please note that I have also posted this on StackOverflow: 
http://stackoverflow.com/questions/7881122/cxf-restful-client-how-to-do-trust-all-certs)





Reply via email to