Thursday, August 26, 2021

JSCH "Algorithm negotiation fail" error

It was received the following error when creating SSH session using JSCH client. I was able to resolve this after updating JSCH version to 0.1.54.

com.jcraft.jsch.JSchException: Algorithm negotiation fail

        at com.jcraft.jsch.Session.receive_kexinit(Session.java:583)

        at com.jcraft.jsch.Session.connect(Session.java:320)

        at com.jcraft.jsch.Session.connect(Session.java:183)

<!-- https://mvnrepository.com/artifact/com.jcraft/jsch -->
<dependency>
    <groupId>com.jcraft</groupId>
    <artifactId>jsch</artifactId>
    <version>0.1.54</version>
</dependency>