425 Unable to build data connection: TLS session of data connection not resumed
Posted: 2023-06-28 21:15
I have recently upgraded the Filezilla server to 1.7.1 with minimum allowed TLS to v1.2, Post the upgrade and TLS version set. The user is able to login to the server but the Client-facing issue listing directories, downloading or uploading to directories.
Connections and directory listing work with Fizilla client from the same source, Issue only when using the homegrown application.
Tried using TLSv1.2 and TLSv1.3 (as FileZille is using TLSv1.3), it still throws the error when do listFiles(): “425 Error while transferring data: PROT C is not allowed when the control connection is secure. Use PROT P.”
And then added line ftp.execPROT("P"); in the code. Then, it throws the error message “425 Unable to build data connection: TLS session of data connection not resumed.” when doing listFiles().
Client using homegrown Java application snippet of the code used.
FTPSClient ftp = new FTPSClient("TLSv1.3");
ftp.connect(ftpProperties.getFtpHost(), ftpProperties.getFtpPort());
ftp.enterLocalPassiveMode();
int reply = ftp.getReplyCode();
if (!FTPReply.isPositiveCompletion(reply)) {
ftp.disconnect();
throw new IOException("Exception in connecting to FTP Server");
}
ftp.execPROT("P");
ftp.login(ftpProperties.getFtpUsername(), ftpProperties.getFtpPassword());
LOGGER.info("Connected to FTP location");
FileOutputStream fos;
LOGGER.info("Downloading files for " + today);
ftp.changeWorkingDirectory(ftpProperties.getFtpDirectory());
FTPFile[] files = ftp.listFiles();
FTPFile[] files = ftp.listFiles(); : Error at this line “425 Unable to build data connection: TLS session of data connection not resumed.”
Connections and directory listing work with Fizilla client from the same source, Issue only when using the homegrown application.
Tried using TLSv1.2 and TLSv1.3 (as FileZille is using TLSv1.3), it still throws the error when do listFiles(): “425 Error while transferring data: PROT C is not allowed when the control connection is secure. Use PROT P.”
And then added line ftp.execPROT("P"); in the code. Then, it throws the error message “425 Unable to build data connection: TLS session of data connection not resumed.” when doing listFiles().
Client using homegrown Java application snippet of the code used.
FTPSClient ftp = new FTPSClient("TLSv1.3");
ftp.connect(ftpProperties.getFtpHost(), ftpProperties.getFtpPort());
ftp.enterLocalPassiveMode();
int reply = ftp.getReplyCode();
if (!FTPReply.isPositiveCompletion(reply)) {
ftp.disconnect();
throw new IOException("Exception in connecting to FTP Server");
}
ftp.execPROT("P");
ftp.login(ftpProperties.getFtpUsername(), ftpProperties.getFtpPassword());
LOGGER.info("Connected to FTP location");
FileOutputStream fos;
LOGGER.info("Downloading files for " + today);
ftp.changeWorkingDirectory(ftpProperties.getFtpDirectory());
FTPFile[] files = ftp.listFiles();
FTPFile[] files = ftp.listFiles(); : Error at this line “425 Unable to build data connection: TLS session of data connection not resumed.”