データ チャネルでの暗号化を必要とする FTP サーバー (ProFTPD 1.3.3a) で FTPClient を使用してデータを読み取る際に問題があります。他のサーバーで暗号化しなくても、すべてが正常に機能します。
私のコードは次のとおりです。
FTPSClient ftpsClient = new FTPSClient("TLS", false);
log.debug("using TLS");
FTPClientConfig ftpClientConfig = new FTPClientConfig(FTPClientConfig.SYST_UNIX);
ftpClientConfig.setServerLanguageCode("de");
ftpsClient.configure(ftpClientConfig);
ftpsClient.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out))); // outputs all conversation to the console
ftpsClient.connect(host, 21);
ftpsClient.login(username, password);
ftpsClient.enterLocalPassiveMode();
ftpsClient.changeWorkingDirectory(pathname);
listNames = ftp.mlistDir();
ftpsClient.logout();
出力から得られるのは
220 ProFTPD 1.3.3a Server (xxx) [xxx]
AUTH TLS
234 AUTH TLS successful
USER xxx
331 Password required for xxx
PASS xxx
230 User xxx logged in
CWD /www/catalog
250 CWD command successful
PASV
227 Entering Passive Mode (xxx).
MLSD
550 SSL/TLS required on the data channel
QUIT
221 Goodbye.
データ チャネルで TLS/SSL を使用するように FTPSClient を構成する方法はありますか? あなたの助けをいただければ幸いです!