“550 SSL/TLS required on the data channel” using Apache Commons FTPSClient

后端 未结 1 1534
迷失自我
迷失自我 2021-01-18 13:16

I have a probleme reading data with FTPClient on a FTP-Server (ProFTPD 1.3.3a) that requires encryption on the data channel. Everything works fine without encryption on an o

相关标签:
1条回答
  • 2021-01-18 13:29

    You must enable data channel encryption before executing any commands that will transfer data over the data channel (such as LIST does).

    Add this to your code after connecting to the server:

    // Set protection buffer size
    ftpClient.execPBSZ(0);
    // Set data channel protection to private
    ftpClient.execPROT("P");
    

    At least, this solved my problems (using proftpd).

    0 讨论(0)
提交回复
热议问题