{
Client client = ClientProxy.getClient(port);
conduit = (HTTPConduit) client.getConduit();
}
TLSClientParameters tlsParams = new TLSClientParameters();
/*Set whether or not JSEE should omit checking if the host name
specified in the URL matches that of the Common Name (CN)
on the server's certificate. Default is false; this attribute
should not be set to true during production use*/
//tlsParams.setDisableCNCheck(true);
//CXF 2.1.3 will give IllegalExpection if you set protocol to SSL.
tlsParams.setSecureSocketProtocol("SSLv3");
//provide trust password
KeyStore keyStore = KeyStore.getInstance("JKS");
String trustpass = trustStorePassword;
// provide your truststore file path
File truststore = new File(trustStoreFilePath);
keyStore.load(new FileInputStream(truststore), trustpass.toCharArray());
TrustManagerFactory trustFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
trustFactory.init(keyStore);
TrustManager[] tm = trustFactory.getTrustManagers();
tlsParams.setTrustManagers(tm);
// provide your client store file path
File keystore = new File(keyStoreFilePath);
keyStore.load(new FileInputStream(keystore), keyStorePassword.toCharArray());
KeyManagerFactory keyFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
keyFactory.init(keyStore, keyStorePassword.toCharArray());
KeyManager[] km = keyFactory.getKeyManagers();
tlsParams.setKeyManagers(km);
conduit.setTlsClientParameters(tlsParams);
}
catch (Exception e)
{