my dog learned polymorphism*
The moose likes Web Services and the fly likes javax.net.ssl.SSLException: SSLSocketFactory is null. This can occur if javax.net.ssl.SSLSocketFacto Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "javax.net.ssl.SSLException: SSLSocketFactory is null. This can occur if javax.net.ssl.SSLSocketFacto" Watch "javax.net.ssl.SSLException: SSLSocketFactory is null. This can occur if javax.net.ssl.SSLSocketFacto" New topic
Author

javax.net.ssl.SSLException: SSLSocketFactory is null. This can occur if javax.net.ssl.SSLSocketFacto

Yogesh Gandhi
Ranch Hand

Joined: Dec 05, 2008
Posts: 207
2012-04-12 19:15:03,350 ERROR com.nucleus.los - javax.wsdl.WSDLException: WSDLException (at /WL5G3N0:definitions/WL5G3N0:types/xsd:schema): faultCode=OTHER_ERROR: An error occurred trying to resolve schema referenced at 'https://osbsesoauat.hdfcbank.com:5142/Cashin_Service/PS_CashinService?SCHEMA%2FCashin_Service%2Fwsdl_schema%2FEnquiryResponse', relative to 'file:/usr/IBM/los/env_was_Cluster1Server1/SOAStackUAT_CashinService.WSDL'.: javax.net.ssl.SSLException: SSLSocketFactory is null. This can occur if javax.net.ssl.SSLSocketFactory.getDefault() is called to create a socket and javax.net.ssl.* properties are not set.


Dear Friends,

Can you please help me what could be the problem.

We are setting the trustStore and keyStore using System.setProperty

But somehow it is not picking up. Can someone please help me out regarding this exception. I am stuck here for 2 days.

Yogesh Gandhi
Ranch Hand

Joined: Dec 05, 2008
Posts: 207
javax.net.ssl.SSLException: SSLSocketFactory is null. This can occur if javax.net.ssl.SSLSocketFactory.getDefault() is called to create a socket and javax.net.ssl.* properties are not set.
at com.ibm.websphere.ssl.protocol.SSLSocketFactory.createSocket(SSLSocketFactory.java:374)
at com.ibm.net.ssl.www2.protocol.https.c.afterConnect(c.java:62)
at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:19)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1044)
at com.ibm.net.ssl.www2.protocol.https.b.getInputStream(b.java:49)
at java.net.URL.openStream(URL.java:1011)
at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(StringUtils.java:158)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(WSDLReaderImpl.java:842)
... 29 more

Posting the exception in formatted way.
Yogesh Gandhi
Ranch Hand

Joined: Dec 05, 2008
Posts: 207
I have set the trust store jks file in javax.net.ssl.trustStore System property.

But still I am getting the message that SSLSocketFactory is null. This could be due to the reason javax.net.ssl.* property not set

There could be two reasons which I feel could be the reason for this failure
1) There is some property which I have not set in System
2) These properties needs to be set somewhere else and not in System class. (Please note that my class is being invoked as Thread by WebSphere).

Can anyone please help me regarding this error?
Yogesh Gandhi
Ranch Hand

Joined: Dec 05, 2008
Posts: 207
System properties approach was not working for me as well.
What came to my rescue was the guide of IBM websphere given on

http://www.redbooks.ibm.com/redbooks/SG247660/wwhelp/wwhimpl/js/html/wwhelp.htm

if you search "CellDefaultTrustStore" in the above guide, you'll find a single page.

You can see CellDefaultTrustStore and NodeDefaultTrustStore.

Earlier i was adding certificate only to NodeDefaultTrustStore, but after reading the guide, i just wanted to try setting the certificate in CellDefaultTrustStore as well and it worked for me !!!
Yogesh Gandhi
Ranch Hand

Joined: Dec 05, 2008
Posts: 207
Yogesh Gandhi wrote:System properties approach was not working for me as well.
What came to my rescue was the guide of IBM websphere given on

http://www.redbooks.ibm.com/redbooks/SG247660/wwhelp/wwhimpl/js/html/wwhelp.htm

if you search "CellDefaultTrustStore" in the above guide, you'll find a single page.

You can see CellDefaultTrustStore and NodeDefaultTrustStore.

Earlier i was adding certificate only to NodeDefaultTrustStore, but after reading the guide, i just wanted to try setting the certificate in CellDefaultTrustStore as well and it worked for me !!!



This can also work if I add the .cer file to CellDefaultTrustStore ONLY. (Addition to NodeDefaultTrustStore is not required)
Guillaume Barry
Greenhorn

Joined: Aug 30, 2013
Posts: 1
Hi,
I found an easier solution. Bug is in fact the following : http://www-01.ibm.com/support/docview.wss?uid=swg1PM14425
I still present in was 8.0

In fact was don't have a default value for property "javax.net.ssl.trustStoreType". So in addition to "javax.net.ssl.trustStore" and "javax.net.ssl.trustStorePassword" add
"javax.net.ssl.trustStoreType=JKS"
Uppercase seems to be important in my environment.

You can do that adding a custom property to the JVM (process definition under the server properties)

Regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javax.net.ssl.SSLException: SSLSocketFactory is null. This can occur if javax.net.ssl.SSLSocketFacto
 
Similar Threads
java.net.UnknownHostException in SSL
SSLHandshakeException
While reading Xml From Https url in java
Multiple protocol support in a SSLServerSocket
Rmi with SSL problem