it.sauronsoftware.ftp4j.FTPClient
FileZilla を使用して接続できるため、ユーザー名/パスワードが正しいことを知っているを使用してファイアウォールをバイパスするために、FTP SITE プロキシ経由で FTP サーバーにアクセスしようとしています。を使ってみAuthenticator
ましたが、使い物になりません。コード:
import java.net.Authenticator;
import it.sauronsoftware.ftp4j.FTPClient;
import it.sauronsoftware.ftp4j.connectors.FTPProxyConnector;
...
FTPClient client = new FTPClient();
FTPProxyConnector connector = new FTPProxyConnector(String "proxyHost", int proxyPort);
client.setConnector(connector);
Authenticator.setDefault(new Authenticator() {
@Override
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication("proxyUser", "proxyPass".toCharArray());
}});
System.setProperty("ftp.proxyHost", "proxyHost");
System.setProperty("ftp.proxyPort", "proxyPort");
System.setProperty("ftp.proxyUser", "proxyUser");
System.setProperty("ftp.proxyPassword", "proxyPass");
System.out.println("Proxy Accessed");
client.connect("ftpHost");
client.login("ftpUser", "ftpPass");
このエラーが表示されます:java.io.IOException: Proxy authentication failed
私が試したこと:
- 代替コンストラクターの使用
(String, int, String, String)
。 - 削除する
Authenticator
Authenticator
FTPProxyConnector を使用せずにだけを使用する- コネクタを設定する前の認証、およびその逆。
ただし、オーセンティケーターを使用しているときは、別のエラーが表示されますConnection timed out
。
どちらのエラーもオンラインで発生しますclient.connect("ftpHost");
任意の助けをいただければ幸いです。
編集: プロキシが Firewall-1 チェックポイントであることがわかりました - これが役立つ場合。