directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r433875 - in /directory: sandbox/trustin/mina-0.8-mvnize/src/main/java/org/apache/mina/examples/echoserver/ssl/ sandbox/trustin/mina-0.8-mvnize/src/test/java/org/apache/mina/examples/echoserver/ trunks/mina/examples/src/main/java/org/apache...
Date Wed, 23 Aug 2006 04:07:41 GMT
Author: trustin
Date: Tue Aug 22 21:07:40 2006
New Revision: 433875

URL: http://svn.apache.org/viewvc?rev=433875&view=rev
Log:
* Fixed a problem with IBM JDKs
* Fixed a problem with Eclipse



Modified:
    directory/sandbox/trustin/mina-0.8-mvnize/src/main/java/org/apache/mina/examples/echoserver/ssl/BogusSSLContextFactory.java
    directory/sandbox/trustin/mina-0.8-mvnize/src/test/java/org/apache/mina/examples/echoserver/AbstractTest.java
    directory/trunks/mina/examples/src/main/java/org/apache/mina/examples/echoserver/ssl/BogusSSLContextFactory.java

Modified: directory/sandbox/trustin/mina-0.8-mvnize/src/main/java/org/apache/mina/examples/echoserver/ssl/BogusSSLContextFactory.java
URL: http://svn.apache.org/viewvc/directory/sandbox/trustin/mina-0.8-mvnize/src/main/java/org/apache/mina/examples/echoserver/ssl/BogusSSLContextFactory.java?rev=433875&r1=433874&r2=433875&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-0.8-mvnize/src/main/java/org/apache/mina/examples/echoserver/ssl/BogusSSLContextFactory.java
(original)
+++ directory/sandbox/trustin/mina-0.8-mvnize/src/main/java/org/apache/mina/examples/echoserver/ssl/BogusSSLContextFactory.java
Tue Aug 22 21:07:40 2006
@@ -22,6 +22,7 @@
 import java.io.InputStream;
 import java.security.GeneralSecurityException;
 import java.security.KeyStore;
+import java.security.Security;
 
 import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.SSLContext;
@@ -40,6 +41,18 @@
      */
     private static final String PROTOCOL = "TLS";
 
+    private static final String KEY_MANAGER_FACTORY_ALGORITHM;
+
+    static {
+	String algorithm = Security.getProperty( "ssl.KeyManagerFactory.algorithm" );
+	if( algorithm == null )
+	{
+	    algorithm = "SunX509";
+	}
+	
+	KEY_MANAGER_FACTORY_ALGORITHM = algorithm;
+    }
+    
     /**
      * Bougus Server certificate keystore file name.
      */
@@ -84,10 +97,10 @@
                         {
                             serverInstance = createBougusServerSSLContext();
                         }
-                        catch( Exception ioe )
+                        catch( Exception e )
                         {
                             throw new GeneralSecurityException(
-                                    "Can't create Server SSLContext:" + ioe );
+                                    "Can't create Server SSLContext.", e );
                         }
                     }
                 }
@@ -138,7 +151,7 @@
         }
 
         // Set up key manager factory to use our key store
-        KeyManagerFactory kmf = KeyManagerFactory.getInstance( "SunX509" );
+        KeyManagerFactory kmf = KeyManagerFactory.getInstance( KEY_MANAGER_FACTORY_ALGORITHM
);
         kmf.init( ks, BOGUS_PW );
 
         // Initialize the SSLContext to work with our key managers.

Modified: directory/sandbox/trustin/mina-0.8-mvnize/src/test/java/org/apache/mina/examples/echoserver/AbstractTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/trustin/mina-0.8-mvnize/src/test/java/org/apache/mina/examples/echoserver/AbstractTest.java?rev=433875&r1=433874&r2=433875&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-0.8-mvnize/src/test/java/org/apache/mina/examples/echoserver/AbstractTest.java
(original)
+++ directory/sandbox/trustin/mina-0.8-mvnize/src/test/java/org/apache/mina/examples/echoserver/AbstractTest.java
Tue Aug 22 21:07:40 2006
@@ -34,7 +34,7 @@
  * @author The Apache Directory Project (dev@directory.apache.org)
  * @version $Rev$, $Date$
  */
-public class AbstractTest extends TestCase
+public abstract class AbstractTest extends TestCase
 {
     protected int port;
 

Modified: directory/trunks/mina/examples/src/main/java/org/apache/mina/examples/echoserver/ssl/BogusSSLContextFactory.java
URL: http://svn.apache.org/viewvc/directory/trunks/mina/examples/src/main/java/org/apache/mina/examples/echoserver/ssl/BogusSSLContextFactory.java?rev=433875&r1=433874&r2=433875&view=diff
==============================================================================
--- directory/trunks/mina/examples/src/main/java/org/apache/mina/examples/echoserver/ssl/BogusSSLContextFactory.java
(original)
+++ directory/trunks/mina/examples/src/main/java/org/apache/mina/examples/echoserver/ssl/BogusSSLContextFactory.java
Tue Aug 22 21:07:40 2006
@@ -22,6 +22,7 @@
 import java.io.InputStream;
 import java.security.GeneralSecurityException;
 import java.security.KeyStore;
+import java.security.Security;
 
 import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.SSLContext;
@@ -40,8 +41,17 @@
      */
     private static final String PROTOCOL = "TLS";
     
-    private static final String KEY_MANAGER_FACTORY_ALGORITHM =
-        System.getProperty( "ssl.KeyManagerFactory.algorithm", "SunX509" );
+    private static final String KEY_MANAGER_FACTORY_ALGORITHM;
+
+    static {
+	String algorithm = Security.getProperty( "ssl.KeyManagerFactory.algorithm" );
+	if( algorithm == null )
+	{
+	    algorithm = "SunX509";
+	}
+	
+	KEY_MANAGER_FACTORY_ALGORITHM = algorithm;
+    }
 
     /**
      * Bougus Server certificate keystore file name.



Mime
View raw message