com.jcraft.jsch.JSchException: Algorithm negotiation fail
at com.jcraft.jsch.Session.receive_kexinit(Session.java:590)
at com.jcraft.jsch.Session.connect(Session.java:320)
at com.jcraft.jsch.Session.connect(Session.java:183)
at com.cashfree.common.dexterreport.sftp.SftpClient.getSftpChannel(SftpClient.java:82)
I am stuck on this, i tried lot's of solution mentioned on the net none worked, the problem is i have to connect to a client to share some files, and we are getting this error
the obvious solution was to change the sshd file but if i can only change it in local only right while the code works from remote and we have to connect to a lot of clients
i tried upgrading the jsch version, nothing worked
Can anyone suggest on how to solve this issue there is fix availabe from mwiede but not sure if it is that much safe or robust, also i came across the comment which says upgrading the wagon ssh version will solve the issue can anyone shed more light on this?
Using jsch version 0.1.55 and java 11
The original JSCH is no longer developed, and it doesn't support modern algorithms that are required to connect to modern versions of OpenSSH.
If you want to use a Java library, then either use the fork of JSCH that contains support for modern algorithms or use Apache MINA, which also supports secure algorithms. While I don't typically code in Java, I think either one should be fine and secure, but if you really insist on a source above all reproach, typically the Apache Software Foundation is considered reputable.