Just want to add that this fails when certificate is not there in keystore my 
requirement is that keystore should not have certificate and still it should 
validate the SSL

Thanks,
Aparna

From: Khare, Aparna
Sent: Tuesday, February 17, 2015 5:53 PM
To: [email protected]
Subject: Implement trust all using apache cxf

Dear Colleagues,

  I'm trying to implement trust all using apach cxf

Created DefaultTrustManager class
 @Override
  public java.security.cert.X509Certificate[] getAcceptedIssuers() {
    return null;
  }

  @Override
  public void checkClientTrusted(final java.security.cert.X509Certificate[] 
certs,
      final String authType) {
  }

  @Override
  public void checkServerTrusted(final java.security.cert.X509Certificate[] 
certs,
      final String authType) {
  }

I have created this class implementing the x509trust manager

And then I call the trust manager using below code

TLSClientParameters tlsParams = new TLSClientParameters();
    TrustManager[] trustAllCerts = new TrustManager[] { new 
DefaultTrustManager() };
    tlsParams.setTrustManagers(trustAllCerts);
    tlsParams.setDisableCNCheck(true);
    conduit.setTlsClientParameters(tlsParams);

still I get certificate validation failed.

Can someone is I have missed something

Thanks,
Aparna

Reply via email to