[英]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.