[ mx4j-Bugs-696211 ] SSLAdaptorServerSocketFactory problem.

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.java.mx4j.devel
Message-ID <[email protected]>
Bugs item #696211, was opened at 2003-03-02 13:34
Message generated for change (Comment added) made by nobody
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=450647&aid=696211&group_id=47745

Category: HTTP Adaptor
Group: Release 1.1.1
Status: Open
Resolution: Accepted
Priority: 5
Submitted By: superbonbon (superbonbon)
Assigned to: Carlos Quiroz (tibu)
Summary: SSLAdaptorServerSocketFactory problem.

Initial Comment:
In the class SSLAdaptorServerSocketFactory
the com.sun.net.ssl.internal.ssl.Provider is used as the 
security provider for ssl sockets.

The problem is that such provider seems to be only 
provided with SUN jdk ( which makes ense.. ). When 
using a IBM JDK 1.4, a class not found exception 
occurs when loading this 
SSLAdaptorServerSocketFactory class, making this 
adapter unworkable under this JDK.

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

Comment By: Nobody/Anonymous (nobody)
Date: 2005-01-25 12:39

Message:
Logged In: NO 

I have a fix to get all running with IBM JDK 1.4:
1) Don't add manually a provider. There's no need.
2) When creating a context with
SSLContext.getInstance(m_sslProtocol), use "SSL" instead of
"TLS".
3) Use "IbmX509" as the algorithm.

Of course I grab this vars from configuration files, so is
very easy go to production (AIX/IBM JDK 1.4) and developing
with Win XP/Sun JDK 1.4.

Congratulations to mx4j team !!!

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

Comment By: Anthony W. Juckel (ajuckel)
Date: 2003-11-18 15:06

Message:
Logged In: YES 
user_id=908721

The following patch at least compiles and runs on both the
Sun and IBM JDK, though I'm getting a problem with the
test.mx4j.tools.adaptor.rmi.JRMPAdaptorTest.testJRMPOverSSL()
test.  It runs fine with the Sun JVM (of course), but I'm
getting an &quot;SSLHandshakeException: protocol version&quot; error
with the IBM JDK 1.4.  I'm not exactly sure why this is, but
I'm also not very familiar with IBM's JDK, so I figured
someone else might have more input.

As a final note, be aware that this patch will break any
semblance of compatibility with 1.3 JVMs.

-----cut patch-----
Index: SSLAdaptorServerSocketFactory.java
===================================================================
RCS file:
/cvsroot/mx4j/mx4j/src/tools/mx4j/tools/adaptor/ssl/SSLAdaptorServerSocketFactory.java,v
retrieving revision 1.1
diff -u -r1.1 SSLAdaptorServerSocketFactory.java
--- SSLAdaptorServerSocketFactory.java	29 Oct 2003
18:12:23 -0000	1.1
+++ SSLAdaptorServerSocketFactory.java	18 Nov 2003 23:04:05
-0000
@@ -17,12 +17,12 @@
 import java.security.UnrecoverableKeyException;
 import java.security.Provider;
 
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLServerSocket;
 import javax.net.ssl.SSLServerSocketFactory;
+import javax.net.ssl.TrustManagerFactory;
 
-import com.sun.net.ssl.KeyManagerFactory;
-import com.sun.net.ssl.SSLContext;
-import com.sun.net.ssl.TrustManagerFactory;
 import mx4j.log.Logger;
 import mx4j.log.Log;
 
@@ -58,10 +58,6 @@
  */
 public class SSLAdaptorServerSocketFactory implements
SSLAdaptorServerSocketFactoryMBean
 {
-	static
-	{
-		addProvider(new com.sun.net.ssl.internal.ssl.Provider());
-	}
 
 	private String m_keyStoreType = &quot;JKS&quot;;
 	private String m_trustStoreType = &quot;JKS&quot;;
@@ -69,8 +65,8 @@
 	private String m_trustStoreName;
 	private String m_keyStorePassword;
 	private String m_trustStorePassword;
-	private String m_keyManagerAlgorithm = &quot;SunX509&quot;;
-	private String m_trustManagerAlgorithm = &quot;SunX509&quot;;
+	private String m_keyManagerAlgorithm =
Security.getProperty(&quot;ssl.KeyManagerFactory.algorithm&quot;);
+	private String m_trustManagerAlgorithm =
Security.getProperty(&quot;ssl.TrustManagerFactory.algorithm&quot;);
 	private String m_keyManagerPassword;
 	private String m_sslProtocol = &quot;TLS&quot;;
 
Index: SSLAdaptorServerSocketFactoryMBeanDescription.java
===================================================================
RCS file:
/cvsroot/mx4j/mx4j/src/tools/mx4j/tools/adaptor/ssl/SSLAdaptorServerSocketFactoryMBeanDescription.java,v
retrieving revision 1.1
diff -u -r1.1 SSLAdaptorServerSocketFactoryMBeanDescription.java
--- SSLAdaptorServerSocketFactoryMBeanDescription.java	29
Oct 2003 18:12:23 -0000	1.1
+++ SSLAdaptorServerSocketFactoryMBeanDescription.java	18
Nov 2003 23:04:05 -0000
@@ -58,11 +58,11 @@
 		}
 		if (attribute.equals(&quot;KeyManagerAlgorithm&quot;))
 		{
-			return &quot;The key algorithm, default is 'SunX509'&quot;;
+			return &quot;The key algorithm, default is the value of the
ssl.KeyManagerFactory.algorithm security property&quot;;
 		}
 		if (attribute.equals(&quot;TrustManagerAlgorithm&quot;))
 		{
-			return &quot;The trust algorithm, default is 'SunX509'&quot;;
+			return &quot;The trust algorithm, default is the value of the
ssl.TrustManagerFactory.algorithm security property&quot;;
 		}
 		if (attribute.equals(&quot;KeyManagerPassword&quot;))
 		{
-----end patch-----

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

Comment By: Carlos Quiroz (tibu)
Date: 2003-08-11 05:34

Message:
Logged In: YES 
user_id=64333

Should be fixed. Probably it should try to use the sun's
class by default but in case some java variable is present
it should use the other class instead.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=450647&aid=696211&group_id=47745


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.