I have an Android application which needs to do some FTP tasks at particular points of the operation:
- Upload a list of files from phone folder to FTP host
- Get list of files in FTP host folder
- Download selected files from FTP to phone, erasing a file from FTP host after download
It is code and working nicely under FTP, but when I go to FTPS (DDL/TLS), it all goes wrong, with the above message.
Download:
2020-08-20 20:45:45.556 17674-18751/com.centralock.android.app.centralock I/System.out: PORT 10,1,10,46,165,169
2020-08-20 20:45:45.716 17674-18751/com.centralock.android.app.centralock I/System.out: 200 PORT command successful
2020-08-20 20:45:45.732 17674-18751/com.centralock.android.app.centralock I/System.out: STOR Folder1/Folder2/File1.txt
2020-08-20 20:47:53.207 17674-18751/com.centralock.android.app.centralock I/System.out: 425 Unable to build data connection: Connection timed out
The attempt to list files does the same thing.
I found some code I thought might help: SSLSessionReuseFTPSClient / prepareDataSocket, but I don't think I installed it properly: I just included the code in my FTP management class file .