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

htony

I tried both separately and each fixed the problem. Thanks for the help.
martin

Re: TLS/SSL Implicit error running from .Net Code, but can manually copy via GUI.

Can you try doing Session.ListDirectory before the Session.PutFiles? It seems there's some problem with the first data connection, possibly due to TLS session reuse.
session.ListDirectory("/some/path")

You can also try setting raw session settings SslSessionReuse to "0":
sessionOptions.AddRawSettings("SslSessionReuse", "0")
htony

TLS/SSL Implicit error running from .Net Code, but can manually copy via GUI.

Hello,
I am having issues copying to TLS/SSL Implicit Server setup from .NET code. On the same machine I am able to copy via the GUI with no issues. Via Code a "425 Can't open data connection" error is being thrown.

This is on a Windows Server 2012 R2 box and I am using version 5.17.1 (build 11087) of WinSCP. I have the WinSCPnet.dll installed in the GAC. Below is the VB.NET code and I have attached two log files, one created via code and one created via the GUI.
Try
    Dim sessionOptions As New SessionOptions
    With sessionOptions
        .Protocol = Protocol.Ftp
        .HostName = "hostName"
        .UserName = "UserName"
        .Password = "Password"
        .FtpSecure = FtpSecure.Implicit
        .TlsHostCertificateFingerprint = "FP"
    End With
 
    Using session As New Session
        session.SessionLogPath = "log.txt"
        session.DebugLogLevel = 2
        session.ExecutablePath = "C:\Program Files (x86)\WinSCP\WinSCP.exe"
        ' Connect
        session.Open(sessionOptions)
        ' Download files
        Dim transferOptions As New TransferOptions
        transferOptions.TransferMode = TransferMode.Binary
        transferOptions.ResumeSupport.State = TransferResumeSupportState.On
        Dim transferResult As TransferOperationResult = Nothing
        transferResult = session.PutFiles()
        ' Throw on any error
        If transferResult IsNot Nothing Then transferResult.Check()
    End Using
Catch ex As Exception
   MsgBox(ex.ToString)
End Try