2017-07-10 97 views
0

的錯誤消息是使用jsch到FTPS到電腦主機 - 連接失敗 - 但FileZilla中工作

com.jcraft.jsch.JSchException:Session.connect:java.net.SocketException異常:軟件導致連接中斷: recv的失敗

認沽文件錯誤:下一步嘗試連接

public void putFileWithPassword(String inputFileName, 
     String outputFileName, String host, int port, 
     String path, String user, String pswd) throws Exception{ 
    say("putFileWithPassword " + outputFileName + " " + host + " " + port + " " + user + " " + pswd); 
    JSch jSch = new JSch(); 
    Session session = jSch.getSession(user, host, port); 
    Properties config = new Properties(); 
    config.put("StrictHostKeyChecking", "no"); 
    session.setConfig(config); 
    session.setPassword(pswd); 
    response = "next step try connecting"+ " " + host + ":" + port + " " + user+" " + pswd; 
    // WHAT ABOUT TLS CERTIFICATES? 
    session.connect(); 
    response = "next step channel open";  

要連接,並與FileZilla中,我們設置傳輸類型= ASCII,設置活動模式轉移,而我們用單引號括起來的文件名的地方該文件位於mainfr上的正確位置AME。

我已經閱讀了幾乎所有當前的問題和答案在stackoverflow.com沒有任何成功。我想我可能需要使用TLS證書,他們是什麼。此外,jcraft.com網站似乎無法使用。

+0

你不是應該使用PASV呢?活動意味着數據連接由SERVER啓動,不能通過大多數防火牆。 –

回答

相關問題