SecureBlackbox 16: Simple commands are executed correctly, but listing or file transfer doesn't work. What should I do?
The FTP protocol uses two socket connections - one for commands (using well-known ports, usually 21 and, rarely, 990) and another for data (the parameters of which are negotiated via the command connection). The presence of the data socket causes problems when there's a NAT, router, or firewall present on the client or on the server or between them.
Toggling Active or Passive Mode
By default, the data connection is established from the server to the client (in the opposite direction to the command connection). This is called Active mode, and this mode is not compatible with most NATs and routers. So, the first thing to try is to toggle the value of the PassiveMode property of the TElSimpleFTPSClient component (switch it from false to true and from true to false and test both ways).
Connecting to a Server behind the NAT
Some servers are also placed behind the NAT, in which case they know only their internal network address and even in passive mode they give the client the wrong address to connect to (for the data channel). In this case, the client should be smart enough to change the address. This is done in the TElSimpleFTPSClient component by setting the AdjustPasvAddress property to true.
Connecting through a Proxy
If you are using a proxy, also try changing the value of UseProxySettingsForDataChannel from false (default) to true.
Troubleshooting FTPS Connections
In case of FTPS (FTP secured with the SSL/TLS protocol) several other properties can be tried. They are EncryptDataChannel and UseSSLSessionResumption. Try switching the boolean value of each property.
Testing with a Third-Party Client
If you have a third-party FTP client that connects to the server, then you can be sure that some combination of settings will work with TElSimpleFTPSClient as well.
We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at support@nsoftware.com.