Java: InvalidAlgorithmParameterException Prime size must be multiple of 64

前端 未结 9 1990
北海茫月
北海茫月 2020-12-10 16:01

I implemented a Java program that will connect and execute a command in a remote server using JSCH. The problem is that whenever I tried to connect to the server, I got the

9条回答
  •  长情又很酷
    2020-12-10 16:26

    I solved a similar problem on oracle java 8 by switching to bouncycastle provider for ssl/tls:

    1. Added bouncycastle to my project

      
          org.bouncycastle
          bcprov-jdk15on
          1.54
      
      
    2. Before I do any SSL stuff, I add the BouncyCastle provider as 1st provider to the list:

      Security.insertProviderAt(new BouncyCastleProvider(),1);
      

    This works with most stuff that uses sun's SSLSocketFactory, so it might also work with JSch.

提交回复
热议问题