Topic "connect with using FTP and SSL/TLS Implicit encryptio"

Author Message
[View user's profile]

Joined: 2012-05-11
Posts: 1
I can connect to a site using the GUI interface but having trouble connecting using My issue appears to be in my inablility to figure out how to include SSL/TLS Implicit encryption in the code. I am using the code below which was taken from a sample found on this site. The log tells me the site is valid but it does not have the correct associated data.
Has anyone succefully used this protocol/Encryption combination?

Imports System
Imports WinSCP
Module Module1

    Sub main()

    End Sub

     Public Function Send_Doc() As Boolean
            ' Setup session options
            Dim sessionOptions As New SessionOptions
            With sessionOptions
                .Protocol = Protocol.Ftp
                .PortNumber = 990
                .HostName = Parm_Destination
                .UserName = Parm_User
                .Password = Parm_PWord
            End With

            Using session As Session = New Session
                ' Connect
                session.SessionLogPath = "c:\WinSCP_Send_File.log"
                ' Upload files
                Dim transferOptions As New TransferOptions
                transferOptions.TransferMode = TransferMode.Binary

                Dim transferResult As TransferOperationResult
                '                                   local   SFTP site
                transferResult = session.PutFiles(SendDoc, Parm_Destination, False, transferOptions)
                ' Throw on any error
                ' Print results
                Dim transfer As TransferEventArgs
                For Each transfer In transferResult.Transfers
                    Console.WriteLine("Upload of {0} succeeded", transfer.FileName)
            End Using
            Return True
        Catch e As Exception
            Console.WriteLine("Error: {0}", e)
            Return False
        End Try
    End Function

End Module
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
Use SessionOptions.FtpSecure
Martin Prikryl

You can post new topics in this forum


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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License