[ openjms-Bugs-1105874 ] Https connector and other JSSEs (IBM in particular)

"SourceForge.net" <[email protected]> Thu, 09 Jun 2005 21:02:59 -0700
Newsgroups gmane.comp.java.openjms.devel
Message-ID <[email protected]>
Bugs item #1105874, was opened at 2005-01-20 21:39
Message generated for change (Comment added) made by tanderson
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=474136&aid=1105874&group_id=54559

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
>Category: client
Group: v0.7.6.1
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Angelo R. Di Filippo (adifilip)
>Assigned to: Tim Anderson (tanderson)
Summary: Https connector and other JSSEs (IBM in particular)

Initial Comment:
Hi all,
I tried to use the https connector of openjms with WAS
and in particular with IBM JDK and I found a lot of
problems. In particular the problem is in the
requirement of the sun JSSE by openjms and in the way
WAS works (every time WAS resets
java.protocol.handler.pkgs system property to its
default value).
To solve the problem I modified 4 classes:

org.exolab.jms.administration.http.SslHttpJmsAdminConnection
org.exolab.jms.client.http.SslHttpJmsServerStub
org.exolab.jms.jndi.http.SslHttpJndiInitialContextFactory
org.exolab.jms.server.http.HttpsJmsServer

Every time I found the code

           System.setProperty(
               "java.protocol.handler.pkgs",
               "com.sun.net.ssl.internal.www.protocol");
           Class providerClass =
              
Class.forName("com.sun.net.ssl.internal.ssl.Provider");
           Provider provider = (Provider)
providerClass.newInstance();
           Security.addProvider(provider);

I substituted it with

       String props =
System.getProperty("java.protocol.handler.pkgs");
       if (props == null) {
           props = "";
       }
       StringTokenizer tokenizer = new
StringTokenizer(props, "|");
       boolean         notFound  = true;         while
(tokenizer.hasMoreTokens()) {
           try {
               Class.forName(tokenizer.nextToken() +
".https.Handler");
               notFound = false;
               break;
           } catch (Exception e) {
           }
       }
       if (props.length() > 0) {
           props += "|";
       }
       if (notFound) {
           System.setProperty(
               "java.protocol.handler.pkgs",
               props +
"com.sun.net.ssl.internal.www.protocol");
           Class providerClass =
              
Class.forName("com.sun.net.ssl.internal.ssl.Provider");
           Provider provider = (Provider)
providerClass.newInstance();
           Security.addProvider(provider);
       }

so that openjms can use the default implementation of jsse.
With this changes to start openjms server with IBM JDK
is neccessary to set in setenv
JAVA_OPT="-Djava.protocol.handler.pkgs=com.ibm.net.ssl.internal.www.protocol".


----------------------------------------------------------------------

>Comment By: Tim Anderson (tanderson)
Date: 2005-06-10 14:02

Message:
Logged In: YES 
user_id=557161

Fixed in CVS. There are no longer any references to 
java.protocol.handler.pkgs or  
com.sun.net.ssl.internal.ssl.Provider, so the suggested fix was not 
required. 

However the fix used means that the JSSE provider must be 
registered statically in the master security properties file. See 
http://java.sun.com/products/jsse/doc/guide/API_users_guide.html
#ProviderCust for more details.

Fix will be available in the 0.7.7 release.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=474136&aid=1105874&group_id=54559


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20