I have this test:

https://git-wip-us.apache.org/repos/asf?p=cxf.git;a=blob;f=systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRS20HttpsBookTest.java;h=818749cf01186d905932e763849471baec407421;hb=HEAD

If I remove the line where the hostname verifier is registered I get an error coming out Java HttpsClient that 'localhost' is problematic...

KeyStore 'keyStore' is not needed if the server requires no TLS client authentication.

What is different in your case ?

Sergey


On 15/04/15 22:06, smq wrote:
Tried to set HostnameVerifier on ClientBuilder - does not work :-(  Here is
the code snippet:

                ClientBuilder clientBuilder = ClientBuilder.newBuilder();
                clientBuilder.hostnameVerifier(new HostnameVerifier(){
                public boolean verify(String hostname, SSLSession sslSession) {
                        return true;
                }
            });
                Client client = clientBuilder.newClient();
                //Client client = ClientBuilderImpl.newClient();
                String urlHost = "https://"; + centralNode;
                WebTarget target = 
client.target(urlHost).path(BASE_SERVICE_URL);
                String encodedpw = Base64.encodeBase64String(passwd.getBytes());
                String body = "{\"uid\" : \"" + uid + "\",\"password\": \"" + 
encodedpw +
"\"}";
                Invocation.Builder builder = 
target.request(MediaType.APPLICATION_JSON);
                Response res = builder.post(Entity.entity(body,
MediaType.APPLICATION_JSON));

Still getting Common Name mismatch exception.





--
View this message in context: 
http://cxf.547215.n5.nabble.com/CXF-3-0-4-client-how-to-disable-CN-checking-tp5755938p5756092.html
Sent from the cxf-user mailing list archive at Nabble.com.



Reply via email to