I've noticed some less than ideal behavior when I declare an HTTP conduit in
the spring configuration of an OSGi bundle. Let's say I have configured an
HTTP conduit in META-INF/spring/module-context.xml:

    <bean id="cxf" class="org.apache.cxf.bus.spring.SpringBus" />

    <jaxws:client
       
name="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}SecurityTokenService";
/>

    <http:conduit name="https://localhost:.*";>
        <http:client ConnectionTimeout="3000000"
            ReceiveTimeout="3000000" />
        <http:tlsClientParameters
            disableCNCheck="true">
            <sec:keyManagers keyPassword="password">
                <sec:keyStore type="JKS" password="password"
                    resource="certs/myKeystore.jks" />
            </sec:keyManagers>
            <sec:trustManagers>
                <sec:keyStore type="JKS" password="password"
                    resource="certs/myTruststore.jks" />
            </sec:trustManagers>
        </http:tlsClientParameters>
    </http:conduit>

    <jaxws:client name="{http://ws.apache.org/axis2}wso2carbon-sts"; />

    <http:conduit name="https://5.42.75.33:.*";>
        <http:tlsClientParameters
            disableCNCheck="true">
            <sec:trustManagers>
                <sec:keyStore type="jks" password="password"
                    resource="certs/myTruststore.jks" />
            </sec:trustManagers>
        </http:tlsClientParameters>
    </http:conduit>

Upon either start-up of the container or first deploy of the bundle I will
get all manner of javax.net.ssl.SSLHandshakeException from clients that
should use the conduit. However, if I either restart the bundle, or
uninstall it then install it again, the exceptions are not thrown again and
the clients connect successfully to their target endpoints. This happens no
matter what kind of CXF client I use. Be it a simple WebClient,
org.apache.cxf.endpoint.Client, or an STSClient.

Thinking it was a timing issue, I went as far as to separate the CXF
configuration from the other beans. I put the configuration in a separate
XML file and loaded it in code through a bundle context before any client
code executes. However, I still see the same behavior.

If anyone could help explain this behavior or at least provide me with some
input on what I could try next to troubleshoot the problem I would really
appreciate it.



--
View this message in context: 
http://cxf.547215.n5.nabble.com/Problems-with-http-conduit-declared-in-OSGi-spring-configuration-tp5727009.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to