I am using CXF 2.7.3 and want to disable CN checking in code with:
TLSClientParameters tlsParams = conduit.getTlsClientParameters();
if (tlsParams == null) {
tlsParams = new TLSClientParameters();
}
tlsParams.setSecureSocketProtocol(sslAlgorithm);
tlsParams.setUseHttpsURLConnectionDefaultHostnameVerifier(false);
tlsParams.setDisableCNCheck(true);
It does not seem to work for me. I've tried all kinds of examples from the WEB with no luck. If I use cxf.xml it works with this:
<http-conf:conduit name="*.http-conduit"
xmlns:sec="http://cxf.apache.org/configuration/security"
xmlns="http://cxf.apache.org/transports/http/configuration">
<http-conf:tlsClientParameters disableCNCheck="true" useHttpsURLConnectionDefaultHostnameVerifier="false" />
</http-conf:conduit>
I would rather not pull in Spring config just to get this one-liner to work. Any ideas? Thanks!