Skip to content

Commit 06efb4b

Browse files
committed
68773: ftp - issue PBSZ command before PROT
1 parent bdf6df5 commit 06efb4b

File tree

1 file changed

+4
-0
lines changed
  • src/main/org/apache/tools/ant/taskdefs/optional/net

1 file changed

+4
-0
lines changed

src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2590,6 +2590,10 @@ public void execute() throws BuildException {
25902590
if (useFtps && useSecureDataChannel) {
25912591
FTPSClient ftps = (FTPSClient) ftp;
25922592
try {
2593+
// first issue a PBSZ command as mandated by RFC-2228.
2594+
// we set 0 because the buffer size is redundant since the encryption
2595+
// is handled at TLS layer and not application layer
2596+
ftps.execPBSZ(0);
25932597
ftps.execPROT("P"); // P implies PRIVATE and enables encryption
25942598
} catch (IOException e) {
25952599
throw new BuildException("failed to enable secure data channel: " + e, e);

0 commit comments

Comments
 (0)