jsch 0.1.55抛出java.io.IOException:io流读取结束

jsch 0.1.55抛出java.io.IOException:io流读取结束,java,sftp,jsch,Java,Sftp,Jsch,我们一直使用jsch-0.1.53.jar每天通过SFTP获取文件,但在运行了几年之后,它现在停止工作了。我想服务器管理员可能已经升级了服务器软件 相关的代码片段(JAVA 1.7)中没有令人惊讶的地方: Hashtable<String, String> config = new Hashtable<String, String>(); config.put("StrictHostKeyChecking"

我们一直使用jsch-0.1.53.jar每天通过SFTP获取文件,但在运行了几年之后,它现在停止工作了。我想服务器管理员可能已经升级了服务器软件

相关的代码片段(JAVA 1.7)中没有令人惊讶的地方:

            Hashtable<String, String> config = new Hashtable<String, String>();
            config.put("StrictHostKeyChecking", "no");
            sftpSession = jsch.getSession(user, host, port);
            sftpSession.setConfig(config);
            sftpSession.setPassword(password);
            sftpSession.connect();
            sftpChannel = (ChannelSftp) sftpSession.openChannel("sftp");
            sftpChannel.connect();
Hashtable config=newhashtable();
配置放置(“检查”、“否”);
sftpSession=jsch.getSession(用户、主机、端口);
sftpSession.setConfig(config);
sftpSession.setPassword(密码);
sftpSession.connect();
sftpChannel=(ChannelSftp)sftpSession.openChannel(“sftp”);
sftpChannel.connect();
最后一行抛出“java.io.IOException:End of io Stream Read”,因此我猜服务器会关闭连接

我升级到jsch 0.1.55(尽管下面的日志声称它是0.1.54),但这并没有改变任何事情

jsch的日志输出如下所示:

*** Connecting to XXXXXXX.XXX.XX port 22
*** Connection established
*** Remote version string: SSH-2.0-7.9.0.0_openssh Globalscape
*** Local version string: SSH-2.0-JSCH-0.1.54
*** CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
*** aes256-ctr is not available.
*** aes192-ctr is not available.
*** aes256-cbc is not available.
*** aes192-cbc is not available.
*** CheckKexes: diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
*** diffie-hellman-group14-sha1 is not available.
*** CheckSignatures: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
*** SSH_MSG_KEXINIT sent
*** SSH_MSG_KEXINIT received
*** kex: server: diffie-hellman-group16-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1
*** kex: server: ssh-rsa
*** kex: server: 3des-cbc,aes256-cbc,aes128-cbc,aes256-ctr,aes128-ctr
*** kex: server: 3des-cbc,aes256-cbc,aes128-cbc,aes256-ctr,aes128-ctr
*** kex: server: hmac-sha1,hmac-md5,hmac-sha1-96,hmac-md5-96
*** kex: server: hmac-sha1,hmac-md5,hmac-sha1-96,hmac-md5-96
*** kex: server: zlib,none
*** kex: server: zlib,none
*** kex: server: 
*** kex: server: 
*** kex: client: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
*** kex: client: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
*** kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc
*** kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc
*** kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
*** kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
*** kex: client: none
*** kex: client: none
*** kex: client: 
*** kex: client: 
*** kex: server->client aes128-ctr hmac-md5 none
*** kex: client->server aes128-ctr hmac-md5 none
*** SSH_MSG_KEX_DH_GEX_REQUEST(1024<1024<1024) sent
*** expecting SSH_MSG_KEX_DH_GEX_GROUP
*** Disconnecting from XXXXXXX.XXX.XX port 22
***连接到XXXXXXX.XXX.XX端口22
***建立连接
***远程版本字符串:SSH-2.0-7.9.0.0_openssh Globalscape
***本地版本字符串:SSH-2.0-JSCH-0.1.54
***校验密码:aes256 ctr、aes192 ctr、aes128 ctr、aes256 cbc、aes192 cbc、aes128 cbc、3des ctr、arcfour、arcfour128、arcfour256
***aes256 ctr不可用。
***aes192 ctr不可用。
***aes256 cbc不可用。
***aes192 cbc不可用。
***复选框:diffie-hellman-group14-sha1、ecdh-sha2-nistp256、ecdh-sha2-nistp384、ecdh-sha2-nistp521
***diffie-hellman-group14-sha1不可用。
***检查签名:ecdsa-sha2-nistp256、ecdsa-sha2-nistp384、ecdsa-sha2-nistp521
***SSH_MSG_KEXINIT已发送
***收到SSH_MSG_KEXINIT
***kex:服务器:diffie-hellman-group16-sha512、diffie-hellman-group14-sha256、diffie-hellman-group14-sha1、diffie-hellman-group-exchange-sha1
***kex:server:ssh-rsa
***kex:服务器:3des cbc、aes256 cbc、aes128 cbc、aes256 ctr、aes128 ctr
***kex:服务器:3des cbc、aes256 cbc、aes128 cbc、aes256 ctr、aes128 ctr
***kex:服务器:hmac-sha1、hmac-md5、hmac-sha1-96、hmac-md5-96
***kex:服务器:hmac-sha1、hmac-md5、hmac-sha1-96、hmac-md5-96
***kex:server:zlib,无
***kex:server:zlib,无
***kex:服务器:
***kex:服务器:
***kex:客户:ecdh-sha2-nistp256、ecdh-sha2-nistp384、ecdh-sha2-nistp521、diffie-hellman-group-exchange-sha256、diffie-hellman-group-exchange-sha1、diffie-hellman-group1-sha1
***kex:客户端:ssh rsa、ssh dss、ecdsa-sha2-nistp256、ecdsa-sha2-nistp384、ecdsa-sha2-nistp521
***kex:客户:aes128中心、aes128 cbc、3des中心、3des cbc、河豚cbc
***kex:客户:aes128中心、aes128 cbc、3des中心、3des cbc、河豚cbc
***kex:客户:hmac-md5、hmac-sha1、hmac-sha2-256、hmac-sha1-96、hmac-md5-96
***kex:客户:hmac-md5、hmac-sha1、hmac-sha2-256、hmac-sha1-96、hmac-md5-96
***kex:客户:无
***kex:客户:无
***kex:客户:
***kex:客户:
***kex:服务器->客户端aes128 ctr hmac-md5无
***kex:客户端->服务器aes128 ctr hmac-md5无

***SSH_MSG_KEX_DH_GEX_请求(1024因为我坚持使用jsch无法解决这个问题,所以我重写了我们的通信层,并用sshj替换了jsch,这在我们的例子中非常简单。
对于任何遇到jsch问题或类似问题的人来说,这可能不是一个可行的解决方案,但对我们来说,它起到了关键作用。

请参见。@Martin:谢谢您的提示,但是升级到openJDK 1.8.252并没有改变任何事情。