Author Topic: FTPS over http proxy ignoring my proxy settings  (Read 727 times)

Cirunz

  • Newbie
  • *
  • Posts: 2
  • Karma: +1/-0
    • View Profile
FTPS over http proxy ignoring my proxy settings
« on: November 14, 2017, 09:25:08 AM »
Hi!
I'm need to connect to an ftps server, over an http proxy (http connect 1.1, no SOCKS), and unluckily there's no way around that.
I entered the configuration in the HttpProxy in the ftp2 class (the same parameter works with Filezilla and Rebex, but I obtain the exact same connection error I get without configuring http proxy properties at all.

So I tried with the same settings (even the http proxy ones) on my development PC, on a network without proxy, and it connects and list files perfectly. My guess is: the library seems to ignore the http proxy values, as if I didn't set them at all.

What am I doing wrong?

This is the code:
Code: [Select]
try
{
Chilkat.Ftp2 ftp = new Chilkat.Ftp2();
ftp.UnlockComponent(chilkey);
ftp.ConnectTimeout = 5000;
ftp.ReadTimeout = 5000;
ftp.IdleTimeoutMs = 5000;
ftp.Hostname = "rmftp1.postel.com";
ftp.Port = 2110;
ftp.Username = ftpuser;
ftp.Password = ftppsw;
ftp.AuthTls = true;
ftp.Passive = true;

ftp.HttpProxyAuthMethod = "Basic";
ftp.HttpProxyHostname = "proxywsa.senigallia.it";
ftp.HttpProxyPort = 3128;
ftp.HttpProxyUsername = "SENIGALLIA\\globcom";
ftp.HttpProxyPassword = proxypsw;

if (ftp.Connect())
{
if (ftp.ChangeRemoteDir("/restituzione_flussi"))
{
int filecount = ftp.GetDirCount();
if (filecount >= 0)
{
List<string> elements = new List<string>();
for (int i = 0; i < filecount; i++)
{
if (!ftp.GetIsDirectory(i))
{
elements.Add(ftp.GetFilename(i));
}
}

logline("Found files: " + Environment.NewLine +
string.Join(Environment.NewLine, elements.ToArray()));
}
else
{
logline("Error while obtaining file count: " + ftp.LastErrorText);
}
}
else
{
logline("Error whule changing directory: " + ftp.LastErrorText);
}

ftp.Disconnect();
}
else
{
logline("Error while connecting to remote server: " + ftp.LastErrorText);
}
}
catch (Exception err)
{
logline(err.Message);
}

Attached there is a screenshot of two different test, one after the other: the first is without HttpProxy properties configured, the second is with correct settings.

Thanks

Chilkat

  • Administrator
  • Full Member
  • *****
  • Posts: 103
  • Karma: +6/-0
    • View Profile
Re: FTPS over http proxy ignoring my proxy settings
« Reply #1 on: November 15, 2017, 10:13:45 AM »
Thanks.  I just tested with Chilkat v9.5.0.69 and it worked fine.  Given that you're using v9.5.0.65, check to see if updating to v9.5.0.69 solves the problem.

Cirunz

  • Newbie
  • *
  • Posts: 2
  • Karma: +1/-0
    • View Profile
Re: FTPS over http proxy ignoring my proxy settings
« Reply #2 on: November 15, 2017, 10:54:49 AM »
Thanks.  I just tested with Chilkat v9.5.0.69 and it worked fine.  Given that you're using v9.5.0.65, check to see if updating to v9.5.0.69 solves the problem.

Oh, my bad: I checked if I had the last version but didn't saw the build was different.
Now it works fine, even on my customer machine.

Thank you very much!