0

I am having problems connecting with it.sauronsoftware.ftp4j.FTPClient.

I want to use SFTP but always get errors.

  • If I use:

    sftpClient.setSecurity(FTPClient.SECURITY_FTPES)
    

    I get: ERROR c.l.datamanager.Ftp4jFTPTask - it.sauronsoftware.ftp4j.FTPIllegalReplyException ERROR c.l.datamanager.Ftp4jFTPTask - java.lang.IllegalStateException: Client not connected

  • If I use

    sftpClient.setSecurity(FTPClient.SECURITY_FTPS);
    

    I get: ERROR c.l.datamanager.Ftp4jFTPTask - javax.net.ssl.SSLException: Unsupported or unrecognized SSL message c.l.datamanager.Ftp4jFTPTask - java.lang.IllegalStateException: Client not connected

Please let me know how I can use SFTP in it.sauronsoftware.ftp4j.FTPClient.

Nol4635
  • 631
  • 1
  • 14
  • 24

1 Answers1

1

FTPES is not SFTP. You cannot use FTP(E(S)) library to connect to an SFTP server. FTP and SFTP are two completely different protocols.

You have to use an SFTP library. See Java SFTP Transfer Library

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992