You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by VICTOR <vi...@tlrsoft.com> on 2005/08/10 14:12:57 UTC

SSL + Axis + Java Web Start - Error establishing SSL Default Context

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:victor@tlrsoft.com"victor@tlrsoft.com
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
 
  

RE: SSL + Axis + Java Web Start - Error establishing SSL Default Context

Posted by VICTOR <vi...@tlrsoft.com>.
Thks .. I just solved the problem ... Java web start was using bad path to
search certificates and seems Axis exception bad catched. Indeed very useful
your code ... I will use it in next app. By the way sorry for my english and
thks.



________________________________



Victor Rodriguez Garcia
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 
victor@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.

-----Mensaje original-----
De: csj [mailto:johnsocs@clarkson.edu] 
Enviado el: miércoles, 10 de agosto de 2005 17:25
Para: axis-dev@ws.apache.org
Asunto: Re: SSL + Axis + Java Web Start - Error establishing SSL Default
Context

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.SecureSocketFacto
ry",
                "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(JSSESocketFact
> ory.ja
> va:178)
>  at 
> org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:18
> 3)
>  at
> org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.jav
> a: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_BindingStu
> b.getS
> entDocumentList(Unknown Source)
>  at es.tlrsoft.atidenet.client.AtiClient.test(Unknown Source)  at 
> es.tlrsoft.atidenet.client.ui.JDialogLogin.jButtonAcceptActionPerforme
> d(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:victor@tlrsoft.com"victor@tlrsoft.com
> 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
>
>
>

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.5/67 - Release Date: 09/08/2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.6/69 - Release Date: 11/08/2005
 


Re: SSL + Axis + Java Web Start - Error establishing SSL Default Context

Posted by csj <jo...@clarkson.edu>.
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:victor@tlrsoft.com"victor@tlrsoft.com
> 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
>
>
>