【问题标题】:Using jsch to ftps to a Mainframe computer - fails to connect - but Filezilla works使用 jsch 到 ftps 到大型机计算机 - 无法连接 - 但 Filezilla 工作
【发布时间】:2017-07-10 18:32:27
【问题描述】:

错误信息是

com.jcraft.jsch.JSchException:Session.connect:java.net.SocketException:软件导致连接中止:recv 失败

Put 文件错误:下一步尝试连接

   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,设置活动模式,并在文件名周围使用单引号将文件放置在大型机上的正确位置。

我已经阅读了 stackoverflow.com 中几乎所有当前的问题和答案,但没有任何成功。我在想我可能需要使用 TLS 证书,不管它们是什么。此外,jcraft.com 网站似乎不可用。

【问题讨论】:

  • 您不应该改用 PASV 吗? Active 表示数据连接是由 SERVER 发起的,它不会通过大多数防火墙。

标签: java ftp jsch mainframe ftps


【解决方案1】:

JSch 是 SFTP/SSH 库。

虽然 FTPS、主动模式、TLS 证书都是与 FTP(S) 协议一起使用的术语,但完全不同。

见:

【讨论】:

  • 我知道你想说什么,但我认为关键部分有点隐藏:你不能使用 SFPT 客户端连接到 FTPS 服务器,因为两者完全不同协议。
猜你喜欢
  • 2015-07-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-03-25
  • 2017-04-15
  • 1970-01-01
  • 1970-01-01
  • 2018-06-04
相关资源
最近更新 更多