Victor -

Try writing your own custom socket factory by implementing Axis's
SecureSocketFactory to return sockets with SSLContext's that are set to
use custom key and trust managers.

EXAMPLE:

package package.of.my.SocketFactory

public class SocketFactory implements SecureSocketFactory {

    /* Not sure why you need this but you do :) */
    public IWCSocketFactory(Hashtable table) throws Exception {
    }

    public Socket create(String host,
       int port,
       StringBuffer otherHeaders,
       BooleanHolder useFullURL) throws Exception {

        SSLContext sslCtx = SSLContext.getInstance("SSL");
        sslCtx.init(KeyManager,TrustManager, null);
        int _port = 443;// port
        String hostname = host;
        SSLSocketFactory socketFactory = sslCtx.getSocketFactory();
        SSLSocket theSocket = (SSLSocket)
            socketFactory.createSocket(hostname,_port);
        return theSocket;
    }


then set axis property in your client side BindingStub.java to use the
custom socket factory.

AxisProperties.setProperty("org.apache.axis.components.net.SecureSocketFactory",
                "package.of.my.SocketFactory");


Regards,
Chris..

On Wed, 10 Aug 2005, VICTOR wrote:

> Im trying to establish a ssl conection using axis to a weblogic server using
> an aplication based in java web start.
> I received this error executing it from java web start but from eclipse it
> works ok. In machine of another people sometimes work from java web start
>
> AxisFault
>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>  faultSubcode:
>  faultString: java.net.SocketException: Default SSL context init failed:
> null
>  faultActor:
>  faultNode:
>  faultDetail:
>  {http://xml.apache.org/axis/}stackTrace:java.net.SocketException: Default
> SSL context init failed: null
>  at javax.net.ssl.DefaultSSLSocketFactory.createSocket(Unknown Source)
>  at
> org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.ja
> va:178)
>  at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:183)
>  at
> org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:390)
>  at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:137)
>  at
> org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:
> 32)
>  at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
>  at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
>  at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
>  at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
>  at org.apache.axis.client.Call.invoke(Call.java:2748)
>  at org.apache.axis.client.Call.invoke(Call.java:2424)
>  at org.apache.axis.client.Call.invoke(Call.java:2347)
>  at org.apache.axis.client.Call.invoke(Call.java:1804)
>  at
> es.tlrsoft.atidenet.client.generated.DocumentWebServiceSoap_BindingStub.getS
> entDocumentList(Unknown Source)
>  at es.tlrsoft.atidenet.client.AtiClient.test(Unknown Source)
>  at
> es.tlrsoft.atidenet.client.ui.JDialogLogin.jButtonAcceptActionPerformed(Unkn
> own Source)
>  at es.tlrsoft.atidenet.client.ui.JDialogLogin$2.actionPerformed(Unknown
> Source)
>  at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
>  at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown
> Source)
>  at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
>  at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
>  at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
>  at java.awt.Component.processMouseEvent(Unknown Source)
>  at java.awt.Component.processEvent(Unknown Source)
>  at java.awt.Container.processEvent(Unknown Source)
>  at java.awt.Component.dispatchEventImpl(Unknown Source)
>  at java.awt.Container.dispatchEventImpl(Unknown Source)
>  at java.awt.Component.dispatchEvent(Unknown Source)
>  at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
>  at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
>  at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
>  at java.awt.Container.dispatchEventImpl(Unknown Source)
>  at java.awt.Window.dispatchEventImpl(Unknown Source)
>  at java.awt.Component.dispatchEvent(Unknown Source)
>  at java.awt.EventQueue.dispatchEvent(Unknown Source)
>  at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
>  at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
>  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>  at java.awt.EventDispatchThread.run(Unknown Source)
>
>  {http://xml.apache.org/axis/}hostname:prog15
>
> Any clues?
>
>
>    _____
>
>
>
> V?ctor Rodr?guez Garc?a
> Dpto. de Programaci?n.
> Pol. Ind. A Granxa
> R?a D, paralela 3. Parcelas 143-145
> 36400 O Porri?o (Pontevedra)
> Tel: +34 986 34 41 78
> Fax: +34 986 34 47 66
> HYPERLINK "mailto:[EMAIL PROTECTED]"[EMAIL PROTECTED]
> HYPERLINK "http://www.tlrsoft.com/"www.tlrsoft.com
>
>
> Aviso Legal: La informaci?n que contiene este mensaje es confidencial. ?sta
> informaci?n es enviada a fin de que ?nicamente sea le?da por la(s)
> persona(s) a la(s) que va dirigida. Acceso por otras personas a las cuales
> no est? dirigido el mensaje no es autorizado. Si Ud. no es el destinatario
> del mensaje, queda prohibida cualquier divulgaci?n, duplicaci?n,
> distribuci?n de la informaci?n y puede ser ilegal. Cualquier acci?n tomada o
> dejada de tomar basada en la informaci?n contenida en este mensaje queda
> prohibida y puede ser ilegal. Si el mensaje va dirigido a clientes, las
> opiniones o recomendaciones contenidas en el mensaje se entienden sujetas a
> los t?rminos y condiciones de contrato de servicio.
>
>
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.338 / Virus Database: 267.10.4/66 - Release Date: 09/08/2005
>
>
>

Reply via email to