Hi,
We are using the licensed copy of edtftpj-pro. In our legacy windows 2008 server our code of FTPS is working fine but after migrating the same code to windows 2012 server, we are facing below error:
INFO com.xx.crd.db2prod.ftp.FtpClient -- Starting uploadFile
2019-07-10 11:56:31,147 [main] INFO com.xx.crd.db2prod.ftp.FtpClient -- Connected to FTP server....
2019-07-10 11:56:31,147 [main] INFO com.xx.crd.db2prod.ftp.FtpClient -- Password decrypted....
2019-07-10 11:56:31,225 [main] INFO com.xx.crd.db2prod.ftp.FtpClient -- Logged in to the FTP server
2019-07-10 11:56:31,288 [main] INFO com.xx.crd.db2prod.ftp.FtpClient -- Directory to Transfer file successfully :: AIMZZ-PAT
com.enterprisedt.net.ftp.ssl.SSLFTPException: The AUTH command cannot be used with implicit FTPS.
at com.enterprisedt.net.ftp.ssl.SSLFTPClient.auth(SSLFTPClient.java:1387)
at com.enterprisedt.net.ftp.ssl.SSLFTPClient.reconnect(SSLFTPClient.java:892)
at com.enterprisedt.net.ftp.FTPClient.a(FTPClient.java:2405)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2941)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2908)
at com.xx.crd.db2prod.ftp.FtpClient.uploadFile(FtpClient.java:58)
at com.xx.crd.db2prod.main.DiamondReport.main(DiamondReport.java:112)
Code Snippet: error is from ftp.put below
SSLFTPClient ftp = new SSLFTPClient();
ftp.setRemoteHost( getConfig( "ftpServer" ) );
ftp.setRemotePort(new Integer(getConfig( "ftpPort" )));
ftp.setImplicitFTPS(true);
ftp.setValidateServer(false);
ftp.connect();
logger.info("Connected to FTP server....");
ftp.auth(SSLFTPClient.PROT_PRIVATE);
String password = getConfig( "password" );
String appMalCode = getConfig( "malCode" );
CryptoUtil crypto = new CryptoUtil();
String decodedPassword = crypto.decrypt(password,appMalCode);
logger.info("Password decrypted....");
ftp.login(getConfig( "userName" ), decodedPassword );
logger.info("Logged in to the FTP server");
ftp.setConnectMode(FTPConnectMode.ACTIVE);
ftp.setType(FTPTransferType.ASCII);
// move to sub folder
if("BD0P".equalsIgnoreCase(malCode.trim()))
{
ftp.chdir( getConfig( "BDMailBox" ) );
logger.info("Directory to Transfer file successfully :: "+getConfig( "BDMailBox" ));
}else if("HD0P".equalsIgnoreCase(malCode))
{
ftp.chdir( getConfig( "HDMailBox" ) );
logger.info("Directory to Transfer file successfully :: "+getConfig( "HDMailBox" ));
}else if("PD".equalsIgnoreCase(malCode))
{
ftp.chdir( getConfig( "PDMailBox" ) );
logger.info("Directory to Transfer file successfully :: "+getConfig( "PDMailBox" ));
}
String fileName = String.format(getConfig( "fileName" ), malCode, malCode);
ftp.put(content.getBytes(), fileName);
Can you please advise ASAP?