Thank you for your answer to #1, it worked perfectly!
Your answer to #2 however, is what I initially had, but it does not work. Here is the verbose output from the server:
220-FileZilla Server 0.9.60 beta
220 Welcome to Acme FTPS
---> USER Acme
331 Password required for Acme
---> PASS ********
230 Logged on
---> TYPE I
200 Type set to I
---> PWD
257 "/" is current directory.
---> NOOP
200 OK
---> TYPE A
200 Type set to A
---> PWD
257 "/" is current directory.
---> CWD 45146,724,724
250 CWD successful. "/45146,724,724" is current directory.
---> CWD /
250 CWD successful. "/" is current directory.
---> NOOP
200 OK
---> CWD 45146,724,724
250 CWD successful. "/45146,724,724" is current directory.
---> PWD
257 "/45146,724,724" is current directory.
ERROR [FTPClient] 3 Jul 2018 14:56:14.785 : Failed to configure data socket:java.net.SocketTimeoutException: Read timed out
ERROR [FTPClient] 3 Jul 2018 14:56:14.787 : Caught and rethrowing exception in initPut() : PROT P required
com.enterprisedt.net.ftp.FTPException: 521 PROT P required
at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(FTPControlSocket.java:1330)
at com.enterprisedt.net.ftp.FTPClient.initPut(FTPClient.java:2862)
ERROR [UploadFileTask] 3 Jul 2018 14:56:14.789 : 4:Upload[e:\tmp\test.txt=>test1.out] failed : PROT P required
WARN [FTPTaskProcessor] 3 Jul 2018 14:56:14.790 : Exception thrown in callback: PROT P required : PROT P required
---> NOOP
200 OK
---> PWD
257 "/45146,724,724" is current directory.
Started upload: test1.out
---> PASV
227 Entering Passive Mode (10,30,2,134,255,102)
---> STOR test1.out
521 PROT P required
test1.out - 0
Completed upload: test1.out
---> QUIT
As you can see, nowhere do you execute a 'PROT P' command on my behalf, yet clearly the server is expecting that before I try uploading a file. Thats why I said, if I explicitly run
client.executeCommand("PROT P");
after I connect, but before running client.uploadFile(), it will work!
As I explained above, the problem with this 'solution' is it doesn't work once I enable server validation. I get several 'FTPEx 521 PROT P required', even though I explicitly executed that command just before doing the upload.
So how do I get SecureFileTransferClient to automatically execute a PROT P for me, given that this server requires it?