Something like this look better? My IDE doesn't complain about anything
unresolved :
org.apache.cxf.endpoint.Client client =
org.apache.cxf.frontend.ClientProxy.getClient(irsiService);
org.apache.cxf.endpoint.Endpoint cxfEndpoint = client.getEndpoint();
cxfEndpoint.getOutInterceptors().add(loi);
cxfEndpoint.getInInterceptors().add(lii);
// CXF CLIENT FOR MUTUAL TLS
TLSClientParameters tlsParams = new TLSClientParameters();
final char[] JKS_PASSWORD = "password".toCharArray();
final char[] KEY_PASSWORD = "password".toCharArray();
final KeyStore keyStore = KeyStore.getInstance("JKS");
try (final InputStream is = new
FileInputStream("C:\\Users\\Owner\\IdeaProjects\\test\\src\\main\\resources\\keystore.jks"))
{
keyStore.load(is, JKS_PASSWORD);
}
final KeyManagerFactory kmf =
KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
kmf.init(keyStore, KEY_PASSWORD);
TrustManagerFactory tmf =
TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
tmf.init(keyStore);
tlsParams.setTrustManagers(tmf.getTrustManagers());
tlsParams.setDisableCNCheck(true);
//Client client = ClientProxy.getClient(port);
HTTPConduit http = (HTTPConduit) client.getConduit();
http.setTlsClientParameters(tlsParams);
I already have a client declared from message signing :
org.apache.cxf.endpoint.Client client =
org.apache.cxf.frontend.ClientProxy.getClient(irsiService);
So I am unsure whether to still include : Client client =
ClientProxy.getClient(port); ?
Cheers
--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html