Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Does version 5.7.7.0 support FTP explicit TLS?

I'm not sure you can run compiled C# code against different version of the assembly. But I'm not SSIS expert. Shouldn't the WinSCP .NET assembly be part of your SSIS package? What does it even mean "the server has 5.7.7"? Are you referring to WinSCP or WinSCP .NET assembly? Aren't you relying on the installed version of WinSCP.exe? You should not. Deploy your own version with your SSIS package.
See https://winscp.net/eng/docs/library_ssis#using
Steve34

Re: Does version 5.7.7.0 support FTP explicit TLS?

Thanks Martin, it worked
My SSIS package was developed with the latest version of WinSCP. But the server has 5.7.7. Do you think my SSIS c# code will work on the server?
SessionOptions sessionOptions = new SessionOptions
{
    Protocol = Protocol.Ftp,
    HostName = (string)Dts.Variables["User::HostName"].Value,
    UserName = (string)Dts.Variables["User::UserName"].Value,
    Password = (string)Dts.Variables["User::Password"].Value,
    FtpSecure = FtpSecure.Explicit,
};
 
sessionOptions.AddRawSettings("AddressFamily", "1");
sessionOptions.AddRawSettings("MinTlsVersion", "12");
 
using (Session session = new Session())
{
 
    session.ExecutablePath = (string)Dts.Variables["User::WinSCPexePath"].Value;
 
    // Connect
    session.Open(sessionOptions);
 
    // Upload files
    TransferOptions transferOptions = new TransferOptions();
    transferOptions.TransferMode = TransferMode.Binary;
 
    TransferOperationResult transferResult = session.PutFiles(
        (string)Dts.Variables["User::LocalFilePath"].Value + (string)Dts.Variables["User::LocalFileName"].Value,
         (string)Dts.Variables["User::RemoteDir"].Value,
         true, transferOptions);
 
    // Throw on any error
    transferResult.Check();
martin

Re: Does version 5.7.7.0 support FTP explicit TLS?

You should not use 5.7.7. It's over 5 years old.

Anyway, 5.7.7 supports the FTP with an explicit TLS encryption. But it does not support the ftpes prefix. Instead, use ftp and add -explicit switch. See help open.
Steve34

Does version 5.7.7.0 support FTP explicit TLS?

Apologies if this is documented somewhere. In version 5.7.7.0 is the following supported:
winscp.com /command "open ftpes://ftp.myserver.co.uk|myusr:mypasswd@ftp.myserver.co.uk"