0

I use this code to connect to ftps with explicit encryption

String host = "10.21.13.66";
int port = 21;
String username = "user";
String password = "pass";
 try {
FTPSClient ftpClient = new FTPSClient("ssl",false);
ftpClient.addProtocolCommandListener(new PrintCommandListener(new  PrintWriter(System.out)));
ftpClient.connect(host, port);
int reply = ftpClient.getReplyCode();
if (FTPReply.isPositiveCompletion(reply)) {

// Login
(ftpClient.login(username, password)) 
}
} catch (IOException ioe) {
System.out.println("FTP client received network error");
}

when I try to connect to my own ftps it returns this error: 431 No security resource for TLS/SSL encryption, probably there is no selected SSL certificate

any help would be appreciated;

Narges
  • 1,345
  • 6
  • 14
  • 29

1 Answers1

0

Try setting the auth on ftps client using below code after object is constructed:

ftpClient.setAuthValue("TLS");

Keyur Shah
  • 81
  • 1
  • 6