Friday, January 24, 2014

ftp.exe and passive mode

We discovered that a C++ app running in an Amazon instance could not communicate with the outside world to manipulate files via FTP. While trying to debug this terrible problem I used the built-in ftp.exe Windows app to try and simulate and solve the problem. I expected that the "vanilla" ftp program would be a good base-level way of testing the situation. It turns out that two wrongs had made an even worse wrong. I think I knew this years ago but forgot: ftp.exe does not support passive mode. By using a different FTP client such as Windows Explorer or FileZilla I found that FTP processing worked fine. It turns out that the C++ app needed to flip a property to use passive mode and it would work, and all the testing with ftp.exe was a dreadful waste of time because instead of testing the problem I was actually reproducing it. Part of the awful waste of time was sending PASV commands to ftp.exe, which seemed to be accepted, but actually did nothing.

No comments:

Post a Comment