commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1091787 - /commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java
Date Wed, 13 Apr 2011 14:02:36 GMT
Author: sebb
Date: Wed Apr 13 14:02:36 2011
New Revision: 1091787

URL: http://svn.apache.org/viewvc?rev=1091787&view=rev
Log:
Allow selection of JVM trust manager

Modified:
    commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java

Modified: commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java?rev=1091787&r1=1091786&r2=1091787&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java (original)
+++ commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java Wed Apr 13 14:02:36
2011
@@ -63,7 +63,7 @@ public final class FTPClientExample
         "\t-s - store file on server (upload)\n" +
         "\t-t - list file details using MLST (remote is used as the pathname if provided)\n"
+
         "\t-w msec - wait time for keep-alive reply (setControlKeepAliveReplyTimeout)\n"
+
-        "\t-T  all|valid - use one of the built-in TrustManager implementations\n" +
+        "\t-T  all|valid|none - use one of the built-in TrustManager implementations (none
= JVM default)\n" +
         "\t-# - add hash display during transfers\n";
 
     public static final void main(String[] args)
@@ -189,6 +189,8 @@ public final class FTPClientExample
                 ftps.setTrustManager(TrustManagerUtils.getAcceptAllTrustManager());
             } else if ("valid".equals(trustmgr)) {
                 ftps.setTrustManager(TrustManagerUtils.getValidateServerCertificateTrustManager());
+            } else if ("none".equals(trustmgr)) {
+                ftps.setTrustManager(null);
             }
         }
 



Mime
View raw message