1

I am looking to connect to a server where they support the following key exchange method ecdh-sha2-nistp521 ecdh-sha2-nistp384 ecdh-sha2-nistp256 diffie-hellman-group-exchange-sha256 diffie-hellman-group14 diffie-hellman-group

I am using jsch jsch-0.1.53 and using RSA private/public key to connect to the server. This works fine before not until the server was changed and now returning this strange error

com.jcraft.jsch.JSchException: SSH_MSG_DISCONNECT: 11 No appropriate prime between 1024 and 1024 is available. en at com.jcraft.jsch.Session.read(Session.java:899) at com.jcraft.jsch.Session.connect(Session.java:294) at com.jcraft.jsch.Session.connect(Session.java:154)

I am running and compiling the project using java 1.6.0_16.

Any idea how to resolve this issue please ?

Jeffrey Hitosis
  • 325
  • 3
  • 13

1 Answers1

0

I had the same problem with jsch 0.1.53 and Java 1.7.0_05 It got solved when I update to Java 1.8_101

Arcones
  • 3,954
  • 4
  • 26
  • 46
  • I've updated to Java 1.8.0_111 and still doesn't work. Is there any configuration that needs to set? – Jeffrey Hitosis Mar 23 '17 at 07:49
  • @JeffreyHitosis another approach will be to use a library different for the problematic operation. For example, in a project where I was forced to use Java 1.7 and couldn't fix the problem upgrading, I overwrite JCE configuration in runtime with BouncyCastle cryptography library that performs the operation with no errors. – Arcones Mar 24 '17 at 08:46
  • The weird thing here is when I updated my java version, and run the application through eclipse, I can connect to server. However, the issue suddenly appeared again. – Jeffrey Hitosis Mar 28 '17 at 07:42