Here is the current setup. Using IbmJsseProvider. NT box + WAS 5.0 +
global security enabled + custom registry security + app security
disabled + no security credentials in application.
java.security:
security.provider.1=sun.security.provider.Sun
security.provider.2=com.ibm.crypto.provider.IBMJCE
security.provider.3=com.ibm.jsse.IBMJSSEProvider
JVM args:
-Djava.protocol.handler.pkgs=com.ibm.net.ssl.internal.www.protocol
-Djavax.net.ssl.trustStorePassword=****(right pass here)
-Djavax.net.ssl.trustStore=C:/Progra~1/WebSphere/AppServer/etc/DummyServerTrustFile.jks
-Djavax.net.debug=true
Code making call:
// this is redundant b/c already there in the JVM args above...
// but setting here also.
System.setProperty("java.protocol.handler.pkgs",
"com.ibm.net.ssl.internal.www.protocol");
URL url = new URL(HTTPS_URL);
BufferedReader in = new BufferedReader(new
InputStreamReader(url.openStream())); <-- errors out on this line..
Exception stack:
java.lang.NullPointerException
com.ibm.ws.orbimpl.transport.protocol.https.HttpsURLConnection.connect
158
Exception = java.lang.NullPointerException
Source = com.ibm.ws.orbimpl.transport.protocol.https.HttpsURLConnection.connect
probeid = 158
Stack Dump = java.lang.NullPointerException
at com.ibm.ws.security.orbssl.ExtendedSSLConnectionData.initSSL(ExtendedSSLConnectionData.java:136)
at com.ibm.ws.security.orbssl.ExtendedSSLConnectionData.<init>(ExtendedSSLConnectionData.java:122)
at com.ibm.ISecurityLocalObjectBaseL13Impl.SecurityConnectionInterceptor.getSSLConfigurationParameters(SecurityConnectionInterceptor.java:4277)
at com.ibm.ws.orbimpl.transport.protocol.https.HttpsURLConnection.connect(HttpsURLConnection.java:123)
at com.ibm.ws.orbimpl.transport.protocol.https.HttpsURLConnection.getInputStream(HttpsURLConnection.java:192)
at java.net.URL.openStream(URL.java:826)
at com.mycompany.class.HttpsConnectClass.submit(HttpsConnectClass.java:275)
The exception stack shows that the class used is
'com.ibm.ws.orbimpl.transport.protocol.https.HttpsURLConnection' but
looking into the ibmJsse jar I find the file
'com.ibm.net.ssl.internal.www.protocol.https.HttpsURLConnection'.
should WAS be using the latter instead?? if so how do I make it do so.
I thought this line should make it do so --
-Djava.protocol.handler.pkgs=com.ibm.net.ssl.internal.www.protocol.
Also this application (Https call) WORKS on WSAD 5.0??? So I am
totally stumped..
if anybody's run into this please help out...
pratap
After hours of digging around...finally found a fix ...acutually
couple
bad config in the appserver cause the problem
solution 1) change config
in admin console
Resources->Url Providers
Select Sample URL provider and delete it.
click on the appropriate scope in the panel above (eg. server) and
click apply.this creates a new url provider.
restart server.
solution 2) code change
use the URL(URLContext, String, URLSTreamHandler) class to make the
connection.
new com.ibm.net.ssl.internal.www.protocol.https.Handler() for the
handler and null for the context
Either solution will make HTTPS to work on the NT. However on the
iSeries this still errors out with a java.lang.AbstractMethodError.
the logs show that it is using the right impl i.e.
com/ibm/net/ssl/internal/www/protocol/https/HttpsURLConnection
java.lang.AbstractMethodError
java/lang/Throwable.<init>()V+4 (Throwable.java:78)
java/lang/Error.<init>()V+1 (Error.java:37)
java/lang/AbstractMethodError.<init>()V+1
(AbstractMethodError.java:30)
com/ibm/net/ssl/www/protocol/https/b.b(Ljavax/net/ssl/HostnameVerifier;)V+0
(:??)
com/ibm/net/ssl/www/protocol/https/b.n()V+0 (:??)
com/ibm/net/ssl/www/protocol/https/p.connect()V+0 (:??)
com/ibm/net/ssl/www/protocol/http/bw.getInputStream()Ljava/io/InputStream;+0
(:??)
com/ibm/net/ssl/internal/www/protocol/https/HttpsURLConnection.getInputStream()Ljava/io/InputStream;+0
(:??)
java/net/URL.openStream()Ljava/io/InputStream;+4 (URL.java:798)
Currently talking to IBM for an resolution on this. will post the
solution if/when get one.
pratap.