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.dllinstalled 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