无法使用java连接到FTPS(显式)服务器?
我使用此代码通过显式加密连接到ftps无法使用java连接到FTPS(显式)服务器?,java,ssl,ftps,apache-commons-net,Java,Ssl,Ftps,Apache Commons Net,我使用此代码通过显式加密连接到ftps 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 PrintWri
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");
}
当我尝试连接到自己的ftps时,它返回以下错误:431没有TLS/SSL加密的安全资源,可能没有选择的SSL证书
任何帮助都将不胜感激 构建对象后,尝试使用以下代码在ftps客户端上设置身份验证:
ftpClient.setAuthValueTLS 同样的例外情况也发生在创建服务器时,我没有为它设置证书,因为我认为证书只是用于隐式连接,但我错了