Open Atharva-2157 opened 3 weeks ago
@Atharva-2157 This error looks like it is coming from the Curve25519DH class as part of the key agreement initialization process.
Some Java Security Provider implementations have slight variations the encoded key handling, which could be an area for improvement in this class.
Can you provide the specific version of Java, and the version of the Bouncy Castle library that results in this particular error?
Java 11.0.19
Bouncy Castle -
sshj -
Thanks for those details @Atharva-2157, that will be helpful in attempting to reproduce the problem.
@Atharva-2157 I was able to reproduce the problem on Java 11.
The problem is the result of different behavior in the Java 11 implementation of X25519
public keys, as opposed to Bouncy Castle and more recent Java versions.
I submitted pull request #959 to improve the behavior, making it more compatible across versions and providers.
With the existing version, it seems like the Bouncy Castle Provider is not being registered, and registering it may resolve the issue without code changes.
I am trying to connect to sftp server using SSHClient.
But at connect method I am getting this error - X25519 unsupported public key length [46] I tried to find the solution online but not found any can anyone help me to solve this.