Home Forums ActiveX components Xceed FTP for ActiveX SSL File Transfer Problem

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #42703 |

    When I try to transfer a file with no authentication it works great. When I try to send the file with TLS Auth I login and get a Cannot OPen Data Connection error.

    ———————————-
    This is my auth call:

    m_AsyncFtpClient.BeginAuthenticate( _
    AuthenticationMethod.Tls, VerificationFlags.None, Nothing, DataChannelProtection.Private, _
    New AsyncCallback(AddressOf Me.AuthenticateCompleted), Nothing)

    I can run the sample client ftp app provided and transfer files using TLS Auth. Is there something that the sample does behind the scenes that I missed between login and transferring files that needs to be done on a secure connection vs. a non-secure connection? Again all works fine on non secure transfer.

    Thanks for any help,
    BARRY

    ————————————–
    This is the trace file:
    Connected to XXX.XXX.XXX.XX:21 on 11/19/2004 @ 10:32:16 AM
    < 220 Serv-U FTP Server v5.0 for WinSock ready…
    > AUTH TLS
    < 234 AUTH command OK. Initializing SSL connection.
    > PROT P
    < 200 PROT command OK. Using private data connection.
    > USER XXXXXXX
    < 331 User name okay, need password.
    > PASS XXXXXXX
    < 230 User logged in, proceed.
    > TYPE A
    < 200 Type set to A.
    > PORT XXX,XXX,XXX,XXX,X,153
    < 200 PORT Command successful.
    > STOR ReportTest/ftpisolist2.xml
    < 150 Opening ASCII mode data connection for ftpisolist2.xml.
    < 425 Cannot open data connection.
    Disconnected from XXX.XXX.XXX.XX:21 on 11/19/2004 @ 10:32:37 AM

    Imported from legacy forums. Posted by Gator1726 (had 4217 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi Barry.

    When you run without SSL authentication or run the sample, can you check if you are running in “PORT” mode? (FtpClient.PassiveTransfer = false). Maybe the server can’t connect to your local port. (firewall or proxy problem?)

    Also, can you check if the sample is passing “DataChannelProtection.Private” or “DataChannelProtection.Clear”?

    Imported from legacy forums. Posted by Martin (had 188 views)

    User (Old forums)
    Member
    Post count: 23064

    I have passive transfer set to false in both the sample app and my app. Originially I had passive mode one and I could not get through the firewall.

    The sample is passing DataChannelProtection.Private as am I.

    Some more info: On the ftp server the file I am trying to transfer is created, but with 0 bytes of data. I wonder if there is an issue with the encryption? Is there something I have missed setting?

    I have posted my code if that helps below. It should look remarkably similiar to your sample 🙂

    Thanks,
    BARRY

    ———————————————————–

    Imports Xceed.Ftp
    Imports Xceed.FileSystem
    Imports System.IO
    Imports GETI.ApplicationBlocks.DataAccess
    Public Class FtpEngine

    #Region “Private Declarations”
    Private m_FileToSendFullPath As String
    Private m_FileToSendName As String
    Private m_FTPHostName As String
    Private m_FTPFolderName As String
    Private m_FTPUserName As String
    Private m_FTPPassword As String
    Private m_SecureMode As Boolean
    Private m_PassiveMode As Boolean
    Private m_FTPPort As Integer
    Private WithEvents m_AsyncFtpClient As AsyncFtpClient
    #End Region
    #Region “Private Properties”
    Private Property FiletoSendFullPath() As String
    Get
    Return m_FileToSendFullPath
    End Get
    Set(ByVal Value As String)
    m_FileToSendFullPath = Value
    End Set
    End Property
    Private Property FiletoSendName() As String
    Get
    Return m_FileToSendName
    End Get
    Set(ByVal Value As String)
    m_FileToSendName = Value
    End Set
    End Property
    Private Property FtpHostName() As String
    Get
    Return m_FTPHostName
    End Get
    Set(ByVal Value As String)
    m_FTPHostName = Value
    End Set
    End Property
    Private Property FtpFolderName() As String
    Get
    Return m_FTPFolderName
    End Get
    Set(ByVal Value As String)
    m_FTPFolderName = Value
    End Set
    End Property
    Private Property FtpUserName() As String
    Get
    Return m_FTPUserName
    End Get
    Set(ByVal Value As String)
    m_FTPUserName = Value
    End Set
    End Property
    Private Property FtpPassword() As String
    Get
    Return m_FTPPassword
    End Get
    Set(ByVal Value As String)
    m_FTPPassword = Value
    End Set
    End Property
    Private Property SecureMode() As Boolean
    Get
    Return m_SecureMode
    End Get
    Set(ByVal Value As Boolean)
    m_SecureMode = Value
    End Set
    End Property
    Private Property PassiveMode() As Boolean
    Get
    Return m_PassiveMode
    End Get
    Set(ByVal Value As Boolean)
    m_PassiveMode = Value
    End Set
    End Property
    Private Property FtpPort() As Integer
    Get
    Return m_ftpport
    End Get
    Set(ByVal Value As Integer)
    m_ftpport = Value
    End Set
    End Property
    #End Region

    Public Sub New()
    Xceed.Ftp.Licenser.LicenseKey = “XXXX-XXXX-XXXX-XXXX”
    m_AsyncFtpClient = New AsyncFtpClient
    m_AsyncFtpClient.TraceWriter = New StreamWriter(logfolder\ftp.log)
    m_AsyncFtpClient.Timeout = 15
    End Sub

    Public Sub TransferFile(ByVal FileToSendFullPath As String, _
    ByVal FileToSendName As String, _
    ByVal FTPHostName As String, _
    ByVal FTPFolderName As String, _
    ByVal FTPUserName As String, _
    ByVal FTPPassword As String, _
    ByVal SecureMode As Boolean, _
    ByVal PassiveMode As Boolean, _
    ByVal FTPPort As Integer)

    Try

    Me.FiletoSendFullPath = FileToSendFullPath
    Me.FiletoSendName = FileToSendName
    Me.FtpHostName = FTPHostName
    Me.FtpFolderName = FTPFolderName
    Me.FtpUserName = FTPUserName
    Me.FtpPassword = FTPPassword
    Me.SecureMode = SecureMode
    Me.PassiveMode = PassiveMode
    Me.FtpPort = FTPPort

    m_AsyncFtpClient.PassiveTransfer = PassiveMode
    m_AsyncFtpClient.RepresentationType = RepresentationType.Ascii
    m_AsyncFtpClient.BeginConnect(FTPHostName, FTPPort, New AsyncCallback(AddressOf ConnectCompleted), Nothing)

    While m_AsyncFtpClient.State <> FtpClientState.NotConnected
    Threading.Thread.Sleep(500)
    End While

    m_AsyncFtpClient.TraceWriter.Close()

    ‘ Dim result As IAsyncResult = client.BeginConnect(FTPHostName, 990, AuthenticationMethod.Ssl, VerificationFlags.None, Nothing, Nothing, Nothing)
    ‘ If SecureMode = True Then
    ‘ RemoveHandler ftpclient.CertificateReceived, AddressOf Certificate_Received
    ‘ End If
    Catch ex As Exception
    ExceptionManager.PublishAndThrow(ex)
    Me.DisconnectAction()
    End Try
    End Sub
    Private Sub ConnectCompleted(ByVal result As IAsyncResult)
    Try
    m_AsyncFtpClient.EndConnect(result)

    If SecureMode = True Then
    Me.Authenticate()
    Else
    Me.Login()
    End If
    Catch ex As Exception
    ExceptionManager.PublishAndThrow(ex)
    Me.DisconnectAction()
    End Try
    End Sub
    Private Sub Authenticate()
    Try
    m_AsyncFtpClient.BeginAuthenticate( _
    AuthenticationMetho

    Imported from legacy forums. Posted by Gator1726 (had 4285 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.