代理验证失败错误 [英] Proxy Authentication Failed error
问题描述
我想通过FTP站点代理访问FTP服务器使用绕过防火墙 it.sauronsoftware.ftp4j.FTPClient
我知道我的用户名/密码是正确的因为我可以连接使用FileZilla中。我试着用验证器
,但它已经没有用了。 code:
I'm trying to access an FTP server through an FTP SITE Proxy to bypass a firewall using it.sauronsoftware.ftp4j.FTPClient
I know my username/password is correct because I can connect using FileZilla. I tried using Authenticator
, but it has no use. Code:
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.proxyPass", "proxyPass");
System.out.println("Proxy Accessed");
client.connect("ftpHost");
client.login("ftpUser", "ftpPass");
给我这个错误: java.io.IOException异常:代理身份验证失败
东西我曾尝试:
- 使用可选的构造
(字符串,整数,字符串,字符串)
。 - 删除
验证器
- 只需使用
验证器
,没有FTPProxyConnector - 设置身份验证连接器,反之亦然之前。
- Using the alternate constructor
(String, int, String, String)
. - Removing
Authenticator
- Using just
Authenticator
, without the FTPProxyConnector - Authenticating before setting the connector, and vice versa.
然而,当我只是使用验证器,我得到一个不同的错误说连接超时
。
However, when I am JUST using the Authenticator, I get a different error saying Connection timed out
.
在网上出现这两个错误 client.connect(ftpHost);
Both errors occur on line client.connect("ftpHost");
任何帮助将AP preciated。
ANY help would be appreciated.
请注意:<一href=\"http://www.sauronsoftware.it/projects/ftp4j/api/it/sauronsoftware/ftp4j/connectors/FTPProxyConnector.html\"相对=nofollow> FTP代理连接器
编辑:我发现代理用来绕过防火墙-1检查站 - 如果这有助于
I found out that the proxy is used to bypass a Firewall-1 Checkpoint -- if this helps.
推荐答案
我找到了解决办法...
I found the solution...
我发现的FTP客户端用不同的响应code响应:
I discovered that the FTP client was responding with a different response code:
200用户&lt;用户名&GT;通过FireWall-1的认证验证
在 FTPProxyConnector
来源$ C $ C,任何事物的响应code比普通
In the source code of FTPProxyConnector
, a response code of anything other than the regular
230连接到服务器。登录...
将抛出一个错误。
我不得不反编译为 FTPProxyConnector
类文件,然后修改源$ C $ C,然后重新编译和保存回瓶子里。工作就像一个魅力。
I had to decompile the class file for FTPProxyConnector
and then modify the source code, then recompile and save it back to the jar. Worked like a charm.
这篇关于代理验证失败错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!