繁体   English   中英

无法使用Java连接到FTPS(显式)服务器?

[英]can not connect to FTPS (explicit) server with java?

我使用此代码通过显式加密连接到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  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客户端上设置auth:

ftpClient.setAuthValue(“ TLS”);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM