cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sdoca sdoca <sd...@shaw.ca>
Subject CXF RESTful Client - How to do trust all certs?
Date Mon, 24 Oct 2011 21:43:46 GMT
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)



    

Mime
View raw message