mina-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r746823 - in /mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl: SSLTestTemplate.java impl/AliasKeymanagerTest.java impl/ExtendedAliasKeymanagerTest.java
Date Sun, 22 Feb 2009 21:20:55 GMT
Author: ngn
Date: Sun Feb 22 21:20:54 2009
New Revision: 746823

URL: http://svn.apache.org/viewvc?rev=746823&view=rev
Log:
Making sure our SSL tests work on IBM JDK

Modified:
    mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/SSLTestTemplate.java
    mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/impl/AliasKeymanagerTest.java
    mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/impl/ExtendedAliasKeymanagerTest.java

Modified: mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/SSLTestTemplate.java
URL: http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/SSLTestTemplate.java?rev=746823&r1=746822&r2=746823&view=diff
==============================================================================
--- mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/SSLTestTemplate.java
(original)
+++ mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/SSLTestTemplate.java
Sun Feb 22 21:20:54 2009
@@ -23,10 +23,13 @@
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.net.Socket;
 import java.security.KeyStore;
 
 import javax.net.ssl.KeyManager;
 import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLSocket;
+import javax.net.ssl.SSLSocketFactory;
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.TrustManagerFactory;
 
@@ -104,12 +107,12 @@
 
         // initialize key manager factory
         KeyManagerFactory keyManagerFactory = KeyManagerFactory
-                .getInstance("SunX509");
+                .getInstance(KeyManagerFactory.getDefaultAlgorithm());
         keyManagerFactory.init(store, KEYSTORE_PASSWORD.toCharArray());
 
         // initialize trust manager factory
         TrustManagerFactory trustManagerFactory = TrustManagerFactory
-                .getInstance("SunX509");
+                .getInstance(TrustManagerFactory.getDefaultAlgorithm());
 
         trustManagerFactory.init(store);
         
@@ -119,9 +122,15 @@
         ftpsClient.setKeyManager(clientKeyManager);
         ftpsClient.setTrustManager(clientTrustManager);
 
+        
         String auth = getAuthValue();
         if (auth != null) {
             ftpsClient.setAuthValue(auth);
+            
+            if(auth.equals("SSL")) {
+                // SSLv3 is disabled by default on the JBM JDK, therefore we need to enable
it
+                ftpsClient.setEnabledProtocols(new String[]{"SSLv3"});
+            }
         }
         return ftpsClient;
     }

Modified: mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/impl/AliasKeymanagerTest.java
URL: http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/impl/AliasKeymanagerTest.java?rev=746823&r1=746822&r2=746823&view=diff
==============================================================================
--- mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/impl/AliasKeymanagerTest.java
(original)
+++ mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/impl/AliasKeymanagerTest.java
Sun Feb 22 21:20:54 2009
@@ -44,7 +44,7 @@
                 "src/test/resources/keymanager-test.jks");
         ks.load(fis, "".toCharArray());
 
-        KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
+        KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
         kmf.init(ks, "".toCharArray());
 
         km = kmf.getKeyManagers()[0];

Modified: mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/impl/ExtendedAliasKeymanagerTest.java
URL: http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/impl/ExtendedAliasKeymanagerTest.java?rev=746823&r1=746822&r2=746823&view=diff
==============================================================================
--- mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/impl/ExtendedAliasKeymanagerTest.java
(original)
+++ mina/ftpserver/trunk/core/src/test/java/org/apache/ftpserver/ssl/impl/ExtendedAliasKeymanagerTest.java
Sun Feb 22 21:20:54 2009
@@ -44,7 +44,7 @@
                 "src/test/resources/keymanager-test.jks");
         ks.load(fis, "".toCharArray());
 
-        KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
+        KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
         kmf.init(ks, "".toCharArray());
 
         km = kmf.getKeyManagers()[0];



Mime
View raw message