Skip to content

FTPS 534 response when writing files. #262

@jacklockyerstevens

Description

@jacklockyerstevens

🦶 What I did?

  1. Instantiate an FTPS client using UnsecureFtp.connect[IO](UnsecureFtpSettings.ssl(...))
  2. Pass Stream[IO,Byte] through the upload method pipe.
...
val client = UnsecureFtp.connect[IO](UnsecureFtpSettings.ssl(...))
finiteByteStream.through(connection.upload("filePath"))

🆘 Problem OR Log error

Nothing happens. The stream never terminates.
Placing an IDE debug point in the Java library and running the getReply method on the client reveals the server returned a 534.
I appreciate this may not be reproducible, as this is partly a result of the config of our FTP server.

🤔 Expectation

The write operation should have run successfully and the stream terminated.

📝 Notes

This appears to be an issue with the underlying Apache Commons library, which suggests a fix of running the following code after logging in:

c.setFileType(FTP.BINARY_FILE_TYPE);
c.execPBSZ(0);  // Set protection buffer size
c.execPROT("P"); // Set data channel protection to private
c.enterLocalPassiveMode();

The first and final line are already handled in the connect method, however the middle two are not.

Additional documentation suggests that PBSZ=0 and PROT=P are the only sensible values to set when using FTPS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions