0 votes

Our customer changed his ftp server. When I changed his ftp addresses setting it failed to upload the report. I updated to the newest ftp.dll and I was able to upload from my developer box fine, but not from my production server. My ASP.net web site delivers a pdf report by ftps to the customer.

The production server is hosted on Azure. Developer Box is Win10. Developer box works fine. Production server generates this error. The error appears to be with the line: ftpclient.Upload(filesuffix + ".pdf", Stream)

I'm stuck...

The error:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 71.92.168.85:64100

My working code:

Limilabs.FTP.Log.Enabled = True

AddHandler Limilabs.FTP.Log.WriteLine, Sub(s) logit.LogTest(ClinicID, sTestID, s)

'/set up for tls 1.2
Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 Or SecurityProtocolType.Ssl3


Using ftpclient As New Ftp()

    AddHandler ftpclient.ServerCertificateValidate, AddressOf ValidateCerificate
    logit.LogTest(ClinicID, sTestID, "TFOC FTP addhandler Finished admin page")


    ftpclient.IgnorePassiveModeAddress = False
    logit.LogTest(ClinicID, sTestID, "TFOC FTP passive mode Finished ")

    '/ IgnorePassiveModeLocalAddress 
    ftpclient.IgnorePassiveModeLocalAddress = True
    logit.LogTest(ClinicID, sTestID, "TFOC FTP passive mode Finished ")

    ftpclient.ConnectSSL("xxxxxxxx", 990)    
    logit.LogTest(ClinicID, sTestID, "TFOC FTP connect ssl Finished admin page")

    ftpclient.Login("xxx", "xxxxxxxx")
    logit.LogTest(ClinicID, sTestID, "TFOC FTP login Finished admin page")

    ftpclient.Upload(filesuffix + ".pdf", Stream)
    logit.LogTest(ClinicID, sTestID, "TFOC FTP upload Finished admin page")

    ftpclient.Close()

End Using

'/RemoveHandler Limilabs.FTP.Log.WriteLine, Sub(s) ftpLog(s)

Limilabs.FTP.Log.Enabled = False


xMessString = "TFOC FTP Transfer Finished"
logit.LogTest(ClinicID.Trim, TestID, "TFOC FTP Transfer Finished admin page") 

Log File:

Connecting to 'xxxxxx   990', SSL    True.
Control connection uses port     52952 (206,216)    
S    220 Syncplify.me Server! v5.0.18.518 FTP(E/S) Service Ready    
TFOC FTP connect ssl Finished admin page            
C    USER MSQS  
S    331 User name okay, need password. 
C    PASS xxxxxxxxxxxx  
S    230 User logged in, proceed.   
C    FEAT   
S    211-Extended features supported    
S     UTF8  
S     CLNT  
S     CSID  
S     SIZE  
S     MDTM  
S     REST STREAM   
S     MLST Type*,Size*,Modify*,Create*UNIX.mode 
S     MLSD  
S     MFMT  
S     PBSZ  
S     AUTH TLS;TLS-P    
S     PROT P    
S     AVBL  
S     COMB  
S     XPWD  
S     XCRC  
S     XMD5  
S     XSHA1 
S    211 END    
C    CLNT Ftp.dll   
S    200 Noted. 
C    OPTS UTF8 ON   
S    200 OPTS UTF8 Command okay.    
TFOC FTP passive mode Finished          
C    TYPE I 
S    200 Command okay.  
C    PBSZ 0 
S    200 Command okay.  
C    PROT P 
S    200 Command okay.  
C    PASV   
S    227 Entering Passive Mode (192,168,1,214,250,100)
TFOC: System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 71.92.168.85:64100
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
   at   .Connect()
   at Limilabs.FTP.Client.Ftp.  ()
   at Limilabs.FTP.Client.Ftp.Upload(String remotePath, Int64 remoteStartPosition, Stream source)
   at Limilabs.FTP.Client.Ftp.Upload(String remotePath, Stream source)
   at Forms_MSQShcp.btn_MedRec_Click(Object sender, EventArgs e) in C:\home\site\wwwroot\Forms\MSQShcp.aspx.vb:line 753
by

1 Answer

0 votes

It looks like client is not able to create a data connection to the FTP server.

I can see the server is incorrectly configured as it sends local network address, instead of public one:

S 227 Entering Passive Mode (192,168,1,214,250,100)

Ftp.dll automatically ignores that....still make sure that the 71.92.168.85 address (control) is correct for data transfers.

As you are able to connect from a different machine I assume the problem is with firewall/av configuration on the production server (client).

Are you sure that firewall on the client allows connecting to non standard ports)(e.g. 64100)?

by (297k points)
...