problem with an ftp server (OpenInsight 32-bit)
At 13 MAR 2013 08:32:25AM Enrique Murphy wrote:
Hi, I am experiencing a problem with an ftp server. I was downloading files correctly, but from a week ago, something changed and now ftplist and ftpgetfile fail. I haven't change anything in the program that does the downloading, and the user and password haven't changed, since I can connect and download using WinSCP or FileZilla and works from those programs. Maybe they have changed default mode in the server, from passive to active or something like that?
At 13 MAR 2013 09:46AM Dave Harmacek wrote:
I don't see in the ProgRef how you can change the Transfer Settings for the ftp functions.
But, I see that in Filezilla, Site Manager, until tab Transfer Settings you have the choices of Default, Active and Passive. Perhaps if you try Active or Passive and see if each works you can determine what you need in ftpgetfile.
Dave Harmacek
Harmacek Database Systems
At 13 MAR 2013 05:19PM Jared Bratu wrote:
That is an excellent suggestion. In addition to using another FTP client to verify active/passive also check if the ftp client automatically encrypts the connection with SSL or TLS. Since FTP is unsecure without special help and it may be the server finally enforced encrypted connections and the test ftp client uses encryption by default.
At 13 MAR 2013 05:21PM Jared Bratu wrote:
The FTPGETFILE command appears to send PASV to enable passive ftp mode. This generally has the highest chance of success since most NAT and firewalls block ACTIVE ftp modes.
The 6th parameter of FTPGETFILE is an error return value. When the connection fails what error is returned?
At 14 MAR 2013 09:01AM Enrique Murphy wrote:
I tested the connection with FileZilla using Active and Passive modes, and works in both of them.
The client doesn't seem to be encrypting after stablishing the connection.
I also tried starting the Application Layer Gateway (ALG) Windows service, as I saw it has something to do with active mode, and unblocking the FTP program in the firewall, but I don't believe OI uses active mode.
The call to FTPLIST or FTPGETFILE delay about 10 seconds, and both of them return without anything in the return value or the error param.
I believe someting has been changed in the ftp server configuration, but people there swear they haven't changed anything…
At 18 MAR 2013 05:21PM Enrique Murphy wrote:
I still have this issue. The problem is that connection is made, but no listing or downloading is possible. Reading about FTP on the web I found that this problem is always due to firewall configuration on one of the sides. In FTP, the port 21 is used for commands and, depending on mode (active or passive) another port is opened for data transmition. I have checked the firewall in two machines with OI and still can't get it working.
I can connect and download without problems from the Windows FTP command line (active mode) and from FileZilla in active and passive mode, from the same machine in which OI fails.
I would like to know how OI connects to the FTP server in the functions ftpgetfile and ftplist:
If is issuing a PORT command or a PASV command (to stablish active or passive mode)
If PORT is issued, which range of port(s) are used by OIWith this info, I can check if the server side firewall is blocking something that OI is trying to use.Regards,
At 19 MAR 2013 08:47AM Jared Bratu wrote:
Check your local firewall and antivirus program. I've seen instances where certain applications get blocked by the firewall while others are allowed. This could explain why command line FTP and FileZilla work yet OpenInsight is blocked.
Does the FTPGetFile and or FTPList commands return immediately with no results and no error or does it take several seconds for the command to fail?
Are you able to connect to any other FTP servers?
If push comes to shove you could always use WireShark or another packet capture program to debug the network connection and see what commands are being issued.
At 19 MAR 2013 10:59AM Enrique Murphy wrote:
Hi Jared,
The firewall is OK on my side. OpenInsight is allowed to use every incoming and outgoing TCP and UDP ports. I can connect, list, and download to another server without any problem from OI, so I think firewall from my side is not the issue.In the case of the server that works, ftplist returns inmediately, as with the server that is not working, takes several seconds, and returns without any error.I would like to know what range of ports ftpgetlist is trying to use, because I believe that the problem could be with OpenInsight trying to use port 20 or another port not enabled in the server for the ftp data connection, while FileZilla or Windows are using other range or ports.