Search code examples
sslhttpswsdlcxfapache-camel

apache camel cxf https not working


I am trying to publish a webservice using apache camel cxf. I am able to access the published webservice using http. However I am trying to configure the same using https. But I am not able to get it to work.

below are parts of spring context and wsdl files

<camel-cxf:cxfEndpoint id="myEndoint"
    address="http://localhost:9000/PostXml/" serviceClass="com.XXXXXXXXXX.techquest.ServicesPortType"
    xmlns:ssp="http://techquest.interswitchng.com/" endpointName="ssp:PostXml"
    serviceName="ssp:PostXml" />

<http:conduit name="*.http-conduit">
    <http:tlsClientParameters
        secureSocketProtocol="SSL">
        <sec:keyManagers keyPassword="password">
            <sec:keyStore type="JKS" password="password"
                file="A:/apache-sermfino_conf/cherry.jks" />
        </sec:keyManagers>
        <sec:trustManagers>
            <sec:keyStore type="JKS" password="password"
                file="A:/apache-ser/truststore.jks" />
        </sec:trustManagers>
        <sec:cipherSuitesFilter>
            <!-- these filters ensure that a ciphersuite with export-suitable or 
                null encryption is used, but exclude anonymous Diffie-Hellman key change 
                as this is vulnerable to man-in-the-middle attacks -->
            <sec:include>.*_EXPORT_.*</sec:include>
            <sec:include>.*_EXPORT1024_.*</sec:include>
            <sec:include>.*_WITH_DES_.*</sec:include>
            <sec:include>.*_WITH_AES_.*</sec:include>
            <sec:include>.*_WITH_NULL_.*</sec:include>
            <sec:exclude>.*_DH_anon_.*</sec:exclude>
        </sec:cipherSuitesFilter>
    </http:tlsClientParameters>
    <http:client AutoRedirect="true" Connection="Keep-Alive" />
</http:conduit>

===============================================================================

<wsdl:portType name="ServicesPortType">
    <wsdl:operation name="PostXml">
        <wsdl:input message="tns:PostXml" />
        <wsdl:output message="tns:PostXml" />
    </wsdl:operation>
</wsdl:portType>            
<wsdl:binding name="ServicesSoap12Binding" type="tns:ServicesPortType">
    <soap12:binding style="document"
        transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="PostXml">
        <soap12:operation soapAction="PostXml" style="document" />
        <wsdl:input>
            <soap12:body use="literal" />
        </wsdl:input>
        <wsdl:output>
            <soap12:body use="literal" />
        </wsdl:output>
    </wsdl:operation>
</wsdl:binding>         
<wsdl:service name="ServicesPortTypeService">
    <wsdl:port binding="tns:ServicesSoap12Binding" name="ServicesSoap12Endpoint">
        <soap12:address location="http://localhost:9000/PostXml" />
    </wsdl:port>
</wsdl:service>

Solution

  • The first one configuration is for the http client not for the server side. You can find the configuration example here[1]

    [1]http://cxf.apache.org/docs/jetty-configuration.html