Topic "How to force IP address for passive mode connections?"

Author Message
steven.dash
[View user's profile]

Joined: 2012-08-23
Posts: 2
Hi,

Here is my code, I dont know where the "Force IP address for passive mode connections" setting is in the .NET assembly, which I have had to enable to transfer a local file to a ftp server through the WinSCP GUI.

Quote:

SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Ftp,
HostName = "sos.com",
UserName = "sos",
Password = "xxxxxxxxx",
SslCertificate = "2b:04:a8L.. ",
FtpMode = FtpMode.Passive,
FtpSecure = FtpSecure.ExplicitTls
};


Without enabling "Force IP address for passive mode connection" setting I get the following error when using WinSCP GUI.

"Server sent passive reply with unroutable address xx.xx.xx.xx, using host address instead"

If I enable the "Force IP address for passive mode connection" setting in the WinSCP GUI everything works fine.

The problem is that I don't know how to enable this setting using the .NET assembly?

Any assistance would be very much appreciated.

Thanks,
Steven
steven.dash
[View user's profile]

Joined: 2012-08-23
Posts: 2
Found the setting.

sessionOptions.AddRawSettings("FtpForcePasvIp2", "0");
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Thanks for your report.

This bug has been added to the tracker:
https://winscp.net/tracker/show_bug.cgi?id=904

I'm sending you a fixed version for testing.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License