You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Kevin Tsoi <kt...@mythum.com> on 2007/10/19 15:55:08 UTC

Default SSL context init failed: null

Hi,

 

I am running into the following exception when using the http client
over ssl.  What seems to be the problem?  Thanks.

 

Default SSL context init failed: null

        at
javax.net.ssl.DefaultSSLSocketFactory.createSocket(SSLSocketFactory.java
:176)

        at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSo
cket(Unknown Source)

        at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSo
cket(Unknown Source)

        at org.apache.commons.httpclient.HttpConnection.open(Unknown
Source)

        at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpCon
nectionAdapter.open(Unknown Source)

        at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Unknow
n Source)

        at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(Unknown
Source)

        at
org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source)

        at
org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source)

 


Re: Default SSL context init failed: null

Posted by Julius Davies <ju...@gmail.com>.
The only other thing I can think of is that webapp B was written back
in Java 1.3 days, and fools around with JCE/JSSE providers, like so?

-------------------------------------------
Class c = Class.forName( "com.sun.crypto.provider.SunJCE" );
Security.addProvider( (Provider) c.newInstance() );

Security.addProvider( new com.sun.net.ssl.internal.ssl.Provider() );
System.setProperty( "java.protocol.handler.pkgs",
"com.sun.net.ssl.internal.www.protocol" );
-------------------------------------------

I would look for "Security.addProvider" or "System.setProperty" being
used in webapp B.


yours,

Julius



On 10/19/07, Kevin Tsoi <kt...@mythum.com> wrote:
> Thanks Julius.  I've read that thread before, but I did not think it was
> applicable to my problem.  The reason being that I have 2 webapps that
> uses the apache http client over ssl, and it seem to be an issue with
> only 1 app.  If I deploy app A first, and then app B, then both app
> works fine.  However, if I deploy B first then A, then both fails.  So
> it seems to be an app issue, not an issue with the java process (tomcat
> in my case).  Thanks.
>
> -----Original Message-----
> From: Julius Davies [mailto:juliusdavies@gmail.com]
> Sent: Friday, October 19, 2007 12:05 PM
> To: HttpClient User Discussion
> Subject: Re: Default SSL context init failed: null
>
> Have you looked at this thread?  (Google for "Default SSL context init
> failed: null").
>
>
> http://forum.java.sun.com/thread.jspa?threadID=647270&messageID=3810778
>
>
> Use this command-line argument on your java process to find out more:
>
> -Djavax.net.debug=all
>
>
> From the thread I linked to, looks like that error will occur if these
> are set as arguments to the java process, and happen to point to
> non-existant (or unreadable) files:
>
> -Djavax.net.ssl.trustStore=TRUSTSTORE
> -Djavax.net.ssl.keyStore=KEYSTORE
>
> But I'm just regurgitating what I read over on the forum.java.sun.com
> thread.  I don't really know.
>
>
> Good luck!
>
> yours,
>
> Julius
>
>
> On 10/19/07, Kevin Tsoi <kt...@mythum.com> wrote:
> > Hi,
> >
> >
> >
> > I am running into the following exception when using the http client
> > over ssl.  What seems to be the problem?  Thanks.
> >
> >
> >
> > Default SSL context init failed: null
> >
> >         at
> >
> javax.net.ssl.DefaultSSLSocketFactory.createSocket(SSLSocketFactory.java
> > :176)
> >
> >         at
> >
> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSo
> > cket(Unknown Source)
> >
> >         at
> >
> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSo
> > cket(Unknown Source)
> >
> >         at org.apache.commons.httpclient.HttpConnection.open(Unknown
> > Source)
> >
> >         at
> >
> org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpCon
> > nectionAdapter.open(Unknown Source)
> >
> >         at
> >
> org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Unknow
> > n Source)
> >
> >         at
> > org.apache.commons.httpclient.HttpMethodDirector.executeMethod(Unknown
> > Source)
> >
> >         at
> > org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source)
> >
> >         at
> > org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source)
> >
> >
> >
> >
>
>
> --
> yours,
>
> Julius Davies
> 250-592-2284
> http://juliusdavies.ca/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
>


-- 
yours,

Julius Davies
250-592-2284
http://juliusdavies.ca/

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


RE: Default SSL context init failed: null

Posted by Kevin Tsoi <kt...@mythum.com>.
Thanks Julius.  I've read that thread before, but I did not think it was
applicable to my problem.  The reason being that I have 2 webapps that
uses the apache http client over ssl, and it seem to be an issue with
only 1 app.  If I deploy app A first, and then app B, then both app
works fine.  However, if I deploy B first then A, then both fails.  So
it seems to be an app issue, not an issue with the java process (tomcat
in my case).  Thanks.

-----Original Message-----
From: Julius Davies [mailto:juliusdavies@gmail.com] 
Sent: Friday, October 19, 2007 12:05 PM
To: HttpClient User Discussion
Subject: Re: Default SSL context init failed: null

Have you looked at this thread?  (Google for "Default SSL context init
failed: null").


http://forum.java.sun.com/thread.jspa?threadID=647270&messageID=3810778


Use this command-line argument on your java process to find out more:

-Djavax.net.debug=all


>From the thread I linked to, looks like that error will occur if these
are set as arguments to the java process, and happen to point to
non-existant (or unreadable) files:

-Djavax.net.ssl.trustStore=TRUSTSTORE
-Djavax.net.ssl.keyStore=KEYSTORE

But I'm just regurgitating what I read over on the forum.java.sun.com
thread.  I don't really know.


Good luck!

yours,

Julius


On 10/19/07, Kevin Tsoi <kt...@mythum.com> wrote:
> Hi,
>
>
>
> I am running into the following exception when using the http client
> over ssl.  What seems to be the problem?  Thanks.
>
>
>
> Default SSL context init failed: null
>
>         at
>
javax.net.ssl.DefaultSSLSocketFactory.createSocket(SSLSocketFactory.java
> :176)
>
>         at
>
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSo
> cket(Unknown Source)
>
>         at
>
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSo
> cket(Unknown Source)
>
>         at org.apache.commons.httpclient.HttpConnection.open(Unknown
> Source)
>
>         at
>
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpCon
> nectionAdapter.open(Unknown Source)
>
>         at
>
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Unknow
> n Source)
>
>         at
> org.apache.commons.httpclient.HttpMethodDirector.executeMethod(Unknown
> Source)
>
>         at
> org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source)
>
>         at
> org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source)
>
>
>
>


-- 
yours,

Julius Davies
250-592-2284
http://juliusdavies.ca/

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Re: Default SSL context init failed: null

Posted by Julius Davies <ju...@gmail.com>.
Have you looked at this thread?  (Google for "Default SSL context init
failed: null").


http://forum.java.sun.com/thread.jspa?threadID=647270&messageID=3810778


Use this command-line argument on your java process to find out more:

-Djavax.net.debug=all


>From the thread I linked to, looks like that error will occur if these
are set as arguments to the java process, and happen to point to
non-existant (or unreadable) files:

-Djavax.net.ssl.trustStore=TRUSTSTORE
-Djavax.net.ssl.keyStore=KEYSTORE

But I'm just regurgitating what I read over on the forum.java.sun.com
thread.  I don't really know.


Good luck!

yours,

Julius


On 10/19/07, Kevin Tsoi <kt...@mythum.com> wrote:
> Hi,
>
>
>
> I am running into the following exception when using the http client
> over ssl.  What seems to be the problem?  Thanks.
>
>
>
> Default SSL context init failed: null
>
>         at
> javax.net.ssl.DefaultSSLSocketFactory.createSocket(SSLSocketFactory.java
> :176)
>
>         at
> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSo
> cket(Unknown Source)
>
>         at
> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSo
> cket(Unknown Source)
>
>         at org.apache.commons.httpclient.HttpConnection.open(Unknown
> Source)
>
>         at
> org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpCon
> nectionAdapter.open(Unknown Source)
>
>         at
> org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Unknow
> n Source)
>
>         at
> org.apache.commons.httpclient.HttpMethodDirector.executeMethod(Unknown
> Source)
>
>         at
> org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source)
>
>         at
> org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source)
>
>
>
>


-- 
yours,

Julius Davies
250-592-2284
http://juliusdavies.ca/

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org