问题是Apache CXF忽略了
bindingProvider.getRequestContext().put( "com.sun.xml.[internal.]ws.transport.https.client.SSLSocketFactory", mySslSocketFactory);
在某些地方有些评论相反。
因此,我的最终解决方案是以编程方式设置HTTPConduit使用的(而不是在cxf.xml文件中设置配置)。
// Set custom SSLContext.HTTPConduit conduit = (HTTPConduit) ClientProxy.getClient(port).getConduit();TLSClientParameters tlsClientParameters = new TLSClientParameters();tlsClientParameters.setSSLSocketFactory(customSSLContext.getSocketFactory());conduit.setTlsClientParameters(tlsClientParameters);
我希望这可以帮助遇到类似问题的人…



