Having troubles connecting thru proxy server using FTP protocol
Posted by - NA - on 11 July 2007 12:58 AM
The Ftp.setProxyAuthentication method sets the and system properties. These properties should be used by the JVM in forwarding socket requests to a SOCKS proxy. It has however been noticed that some JVM do not use this information as is documented in the following:

This appears to be a bug in some JVM. To get around this issue consider registering an Authenticator as follows:

Authenticator auth = new MyAuth(user, password);

class MyAuth extends Authenticator {
* PasswordAuthentication
private PasswordAuthentication defaultAuth;

* @param un
* @param pw
MyAuth(String un, String pw) {
if (pw != null) {
defaultAuth = new PasswordAuthentication(un, pw.toCharArray());
} else {
defaultAuth = new PasswordAuthentication(un, new char[0]);

protected PasswordAuthentication getPasswordAuthentication() {
return defaultAuth;
(126 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Post a new comment
Full Name:
Help Desk Software by Kayako fusion