2 Replies Latest reply on Mar 21, 2011 10:14 AM by asoldano

    JbossWS with SSLSocketFactory on Jboss as 6

    ctomc

      Hi,

       

      I have application that connects via webserivce to ssl secured server that requires client certificate.

      Keystore/truststore in our application is loaded from classpath and then based on some buissnes rules sent to the secured server.

      To achive this I have implemented my own SSLSocketFactory that just that.

       

      My code has worked without any problems in maven executed tests but didn't work in jboss 5.1, after some help from Ales & Alessio we figured out that jboss 5.x uses jboss native ws stack and it needs some aditional parameters when setting binding provider to make it use out ssl socketfactory.

       

      the code to make this work in metro(jaxws-rt) stack and jbossws native is like this:

       

       

           Map<String, Object> ctxt = bindingProvider.getRequestContext();

         ctxt.put(JAXWSProperties.CONNECT_TIMEOUT, connectTimeout);

         ctxt.put(JAXWSProperties.REQUEST_TIMEOUT, readTimeout);

         ctxt.put(JAXWSProperties.SSL_SOCKET_FACTORY, PaymentsSocketFactory.getInstance()); //makes metro work

         ctxt.put("org.jboss.ws.socketFactory", PaymentsSocketFactory.class.getName()); // makes jbossws native work.

       

       

      The problem began with jboss 6, that comes with apache CXF and ignores all the passed properties for setting socket factory.

       

      So how can I make it work also in jboss 6, and also be able to use this code in jboss 5.x?

       

      I was looking around web to found something in cxf documentation but all I could found are some file config based configurations and nothing on how to do it programaticly.

       

      Shouldn't jbossws as "proxy" take care of stuff like this?  That way you could realy transparently change ws stack and everything should work?

       

       

      cheers,

      tomaz