You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2011/04/13 16:02:36 UTC
svn commit: r1091787 -
/commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java
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);
}
}