DH密钥大小必须是64的倍数,并且只能在512到2048(含)范围内 [英] DH key size must be multiple of 64, and can only range from 512 to 2048 (inclusive)
问题描述
我有一个设置,其中我正在通过ANT
中的sshexec
任务在Solaris Server上从Jenkins执行构建.
I have a set-up in which I am executing a build from Jenkins on a Solaris Server connecting via sshexec
task in ANT
.
在触发构建时,它抛出以下错误:
On trigerring the build, it is throwing below error:
com.jcraft.jsch.JSchException:Session.connect: java.security.InvalidAlgorithmParameterException:DH密钥大小必须为 64的倍数,并且只能在512到2048(含)之间变化.这 不支持特定的密钥大小2047.
com.jcraft.jsch.JSchException: Session.connect: java.security.InvalidAlgorithmParameterException: DH key size must be multiple of 64, and can only range from 512 to 2048 (inclusive). The specific key size 2047 is not supported.
经过一些Google搜索,我知道可以通过更新到Java 8来解决它.但是,这样做还是没有成功.
After some google search, I came to know that it might be fixed by updating to Java 8. I did that, however, still no success.
任何人都可以让我知道如何解决此问题吗?
Can anyone please let me know how to fix it?
推荐答案
我们的解决方法:
Security.insertProviderAt(new BouncyCastleProvider(), 1)
我们直接使用Jsch 0.1.54连接到SFT服务器并看到:
we were using Jsch 0.1.54 directly to connect to an SFT server and saw:
java.security.InvalidAlgorithmParameterException:DH密钥大小必须是64的倍数,并且只能在512到4096(含)范围内.不支持特定的密钥大小2047
java.security.InvalidAlgorithmParameterException: DH key size must be multiple of 64, and can only range from 512 to 4096 (inclusive). The specific key size 2047 is not supported
可能相关
- JDK-8164963:使用JSCH库升级JDK后,InvalidAlgorithmParameterException基本大小问题.
- DHGEX在Java 8下使用2048位密钥失败,但是在1024位密钥下成功
- JDK-8164963: InvalidAlgorithmParameterException prime size issue after JDK upgrade with JSCH libraries.
- DHGEX failing with 2048-bit key under Java 8, but succeeding with 1024-bit key
这篇关于DH密钥大小必须是64的倍数,并且只能在512到2048(含)范围内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!