DH key size must be multiple of 64, and can only range from 512 to 2048 (inclusive).

Hello,
I have a set-up in which I am executing a build from Jenkins on a Solaris 10 Server connecting via sshexec task in ANT.

On triggering the build, it is throwing below error:

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.

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?

Thanks,
Nishant

Where in the build is the specific DH key size of 2047 defined? Did you search the source/config files/make files?

This is the build script that I am executing via Jenkins.

<sshexec host="my.host.com" 		username="myuser" 		password="mypass" 		command="touch somefile" 		trust="true" />