0

I'm trying to set disableCNCheck to true for my web service. I'm using Grails 2.2.0 with the Cxf Client plugin.

I found this question:
wsdl2java CXF command line error about disableCNCheck option

with this piece of code:

protected void disableCNCheck(Object port) {
    Client client = ClientProxy.getClient(port)

    TLSClientParameters params = new TLSClientParameters()
    params.setDisableCNCheck(true)
    HTTPConduit httpConduit = (HTTPConduit) client?.getConduit()
    httpConduit?.setTlsClientParameters(params)
}

In which class would this code belong and where would the method be called? Is there a configuration parameter for the Cxf Client plugin that I could set instead?

Community
  • 1
  • 1

1 Answers1

1

Instead of the code you can achieve the disableCNCheck by adding the below xml config to grails-app/conf/spring/resources.xml [ Grails 2.2.3 , cxf-client plugin 1.6.1

<beans xmlns="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       xmlns:http="http://cxf.apache.org/transports/http/configuration" 
       xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
            http://cxf.apache.org/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd
      "> 

  <http:conduit name="*.http-conduit"> 
    <http:tlsClientParameters disableCNCheck="true" /> 
  </http:conduit> 

</beans> 
Ach J
  • 510
  • 5
  • 9