incubator-ftpserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r480968 - in /incubator/ftpserver/trunk/ssl-tests: pom.xml src/test/org/apache/commons/ src/test/org/apache/ftpserver/ssl/ClientAuthTest.java
Date Thu, 30 Nov 2006 15:33:47 GMT
Author: ngn
Date: Thu Nov 30 07:33:46 2006
New Revision: 480968

URL: http://svn.apache.org/viewvc?view=rev&rev=480968
Log:
Make ClientAuthTest work with new version of commons-net. Also remove our patched version
of FTPSClient as the patch is now available in commons-net.

Removed:
    incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/commons/
Modified:
    incubator/ftpserver/trunk/ssl-tests/pom.xml
    incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ClientAuthTest.java

Modified: incubator/ftpserver/trunk/ssl-tests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/ssl-tests/pom.xml?view=diff&rev=480968&r1=480967&r2=480968
==============================================================================
--- incubator/ftpserver/trunk/ssl-tests/pom.xml (original)
+++ incubator/ftpserver/trunk/ssl-tests/pom.xml Thu Nov 30 07:33:46 2006
@@ -93,10 +93,10 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <!-- Currently has to built from source as no up-to-date binary is available
-->
             <groupId>commons-net</groupId>
-            <artifactId>commons-net-ftp</artifactId>
+            <artifactId>commons-net</artifactId>
             <version>2.0.0-SNAPSHOT</version>
-            <!-- Download from http://people.apache.org/~rwinston/commons-net-2.0/commons-net-ftp-2.0.0-SNAPSHOT.jar
-->
         </dependency>
     </dependencies>
 </project>

Modified: incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ClientAuthTest.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ClientAuthTest.java?view=diff&rev=480968&r1=480967&r2=480968
==============================================================================
--- incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ClientAuthTest.java
(original)
+++ incubator/ftpserver/trunk/ssl-tests/src/test/org/apache/ftpserver/ssl/ClientAuthTest.java
Thu Nov 30 07:33:46 2006
@@ -22,6 +22,8 @@
 import java.io.FileInputStream;
 import java.security.KeyStore;
 
+import javax.net.ssl.KeyManagerFactory;
+
 import org.apache.commons.net.ftp.FTPReply;
 import org.apache.commons.net.ftp.FTPSClient;
 
@@ -42,10 +44,14 @@
     protected FTPSClient createFTPClient() throws Exception {
         FTPSClient client = new FTPSClient();
         client.setNeedClientAuth(true);
+        
         KeyStore ks = KeyStore.getInstance("JKS");
         ks.load(new FileInputStream(FTPCLIENT_KEYSTORE), KEYSTORE_PASSWORD);
-        client.setKeystore(ks);
-        client.setKeystorePassword(KEYSTORE_PASSWORD);
+        
+        KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
+        kmf.init(ks, KEYSTORE_PASSWORD);
+
+        client.setKeyManager(kmf.getKeyManagers()[0]);
 
         return client;
     }



Mime
View raw message