Cannot connect to SFP sever using key file with JSch and Java 8

孤街醉人 提交于 2019-12-04 10:53:33

The problem in our case seems to be fixed/worked around by removing diffie-hellman-group-exchange-sha1 before calling session.connect()

String kex = session.getConfig("kex");
System.out.println("old kex:" + kex);
kex = kex.replace(",diffie-hellman-group-exchange-sha1", "");
session.setConfig("kex", kex);
System.out.println("new kex:" + session.getConfig("kex"));
session.connect();

[We control the client, but not the server that we were failing to connect to.]

We have resolved such issue by enabling diffie-hellman-group14 algorithm on SFTP server

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!