Depending on the type of CXF client you have options. If you have a Spring-based client configuration, you should add the attribute to the http:conduit configuration:
<http:conduit name="{http://apache.org/hello_world_soap_http}SoapPort.http-conduit"> <http:tlsClientParameters disableCNCheck="true"> </http:tlsClientParameters> </http:conduit>
name must match the namespace and port name from your WSDL.
If you are creating your client code, use the following code:
HTTPConduit httpConduit = (HTTPConduit) ClientProxy.getClient(port).getConduit(); TLSClientParameters tlsCP = new TLSClientParameters();
where port is the actual client proxy that you are invoking.
Both parameters can be found in the CXF example, which I changed here
BTW. There is a real threat when using this property in a production environment, so please consider issuing a new certificate with the correct CN for the production server, and not depending on this hack.
Dawid pytel
source share