Using Sun JSSE Under IBM JVM
843811May 19 2008 — edited May 21 2008Hello,
I am new to java security and I have a security component that open an HTTPS connection and send a signed message ,this component built using SUN JDK (sun Security Providers and standers ).
the problem that i have is ,i need to use this component under WAS 6.0.1 and IBM JVM that have it is own security providers and standers that have some differences than SUN security provider . in the first time that i tried to run this component i got the follwoing exception :
java.security.NoSuchAlgorithmException: Class com.ibm.jsse.bp configured for SSLContext not a SSLContext at com.sun.net.ssl.SunJSSE_b.a(DashoA12275)
I search about this exception and i find that i have to do the follwing in order to solve this exception:
1- change HTTPS protocol handler to the IBM handler com.ibm.net.ssl.www.protocol.Handlerhandler as follwing :
System.setProperty("java.protocol.handler.pkgs", "com.ibm.net.ssl.www.protocol");
Class.forName("com.ibm.net.ssl.www.protocol.https.Handler");
2- add SUN JSSE jar file to IBM installation/jave/jre/lib
3- update IBM installation/jave/jre/lib/security/java.security file to have sun security provider with IBM security provider:
security.provider.1=sun.security.provider.Sun
security.provider.2=com.sun.net.ssl.internal.ssl.Provider
security.provider.3=com.sun.rsajca.Provider
security.provider.4=com.sun.crypto.provider.SunJCE
security.provider.5=sun.security.jgss.SunProvider
security.provider.6=com.ibm.crypto.provider.IBMJCE
security.provider.7=com.ibm.jsse.IBMJSSEProvider
security.provider.8=com.ibm.jsse2.IBMJSSEProvider2
security.provider.9=com.ibm.security.jgss.IBMJGSSProvider
security.provider.10=com.ibm.security.cert.IBMCertPath
after doing this the previous exception disappear, but a new one appear :
java.lang.ClassCastException: com.ibm.net.ssl.www.protocol.https.t
the snippet of code that coze this error is
java.net.URL url = new java.net.URL(null, "URL",new com.ibm.net.ssl.www.protocol.https.Handler());
com.sun.net.ssl.HttpsURLConnection httpsurlconnection = (com.sun.net.ssl.HttpsURLConnection)url.openConnection();
Kindly i need your help to solve this exception .
Thanks in Advance
Thanks in
Edited by: thaerj on May 19, 2008 1:09 AM