You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Aidan Diffey <ai...@gmail.com> on 2010/12/07 22:57:15 UTC
[NET] FTPES Problems
Hello all.
I have previously posted before, but this time I can give much more detail..
I have setup an vsftpd server (on linux) to use FTPES (TLS) and
AES-256-SHA encryption.
I configure my FTPSClient as specified below, but I get the following error:
*522 SSL connection failed; session reuse required: see
require_ssl_reuse option in vsftpd.conf man page*
I can connect to my FTPES server using FileZilla, but not using Commons
NET. Am I missing something
I am using Java 6 and Common Net 2.2
-------------
package common.ftp;
import java.io.PrintWriter;
import java.net.InetAddress;
import org.apache.commons.net.PrintCommandListener;
import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPSClient;
import trust.MyTrust;
public class FTPTest
{
public static void main(String...strings) throws Exception
{
FTPSClient client = new FTPSClient("TLS", false);
try
{
InetAddress address = InetAddress.getByName("192.168.1.102");
client.connect(address, 21);
client.addProtocolCommandListener(new
PrintCommandListener(new PrintWriter(System.out)));
//client.setTrustManager(new MyTrust());
client.setEnabledCipherSuites(new String[]
{"TLS_RSA_WITH_AES_256_CBC_SHA"});
client.login("aidan", "TtmHD1q7");
client.enterLocalPassiveMode();
client.execPROT("P");
client.execPBSZ(0);
FTPFile[] files = client.listFiles();
for (FTPFile f : files)
{
System.out.println(f.getName());
}
}
finally
{
client.disconnect();
}
}
}