uttamgupta opened a new issue, #746:
URL: https://github.com/apache/mina-sshd/issues/746
### Version
2.14
### Bug description
I am setting key exchange factory like -
`List<KeyExchangeFactory> keyExchangeFactories = List.of(
//DHGClient.newFactory(BuiltinDHFactories.dhg14_256),
DHGClient.newFactory(BuiltinDHFactories.dhgex256),
DHGClient.newFactory(BuiltinDHFactories.ecdhp256),
DHGClient.newFactory(BuiltinDHFactories.ecdhp384),
DHGClient.newFactory(BuiltinDHFactories.ecdhp521));`
Create a client and set like this
sshClient.setKeyExchangeFactories(keyExchangeFactories);
I understand we need to set some parameters but I don't know how. Can any
one help here?
### Actual behavior
```
session.auth().verify(timeOutMillis); -> it throws exception
at com.mina.sshd.common.SshClientImpl.connect(SshClientImpl.java:188)
at com.mina.sshd.common.SshClientImpl.connect(SshClientImpl.java:148)
at SftpTest.setupBefore(SftpTest.java:96)
at
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at
org.junit.internal.runners.statements.RunBefores.invokeMethod(RunBefores.java:33)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at
org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
at
com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
at
com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
at
com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
at
com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55)
Caused by: org.apache.sshd.common.SshException: [ssh-connection]: Failed
(IllegalArgumentException) to execute: Bad parameters for
diffie-hellman-group-exchange-sha256
at
org.apache.sshd.common.future.AbstractSshFuture.lambda$verifyResult$2(AbstractSshFuture.java:146)
at
org.apache.sshd.common.future.AbstractSshFuture.formatExceptionMessage(AbstractSshFuture.java:206)
at
org.apache.sshd.common.future.AbstractSshFuture.verifyResult(AbstractSshFuture.java:145)
at
org.apache.sshd.client.future.DefaultAuthFuture.verify(DefaultAuthFuture.java:56)
at
org.apache.sshd.client.future.DefaultAuthFuture.verify(DefaultAuthFuture.java:35)
at
org.apache.sshd.common.future.VerifiableFuture.verify(VerifiableFuture.java:121)
at com.mina.sshd.common.SshClientImpl.connect(SshClientImpl.java:183)
... 30 more
Caused by: java.lang.IllegalArgumentException: Bad parameters for
diffie-hellman-group-exchange-sha256
at
org.apache.sshd.common.kex.BuiltinDHFactories$9.create(BuiltinDHFactories.java:189)
at org.apache.sshd.client.kex.DHGClient.getDH(DHGClient.java:130)
at org.apache.sshd.client.kex.DHGClient.init(DHGClient.java:100)
at
org.apache.sshd.common.session.helpers.AbstractSession.performKexNegotiation(AbstractSession.java:940)
at
org.apache.sshd.common.session.helpers.AbstractSession.lambda$doKexNegotiation$3(AbstractSession.java:912)
at
org.apache.sshd.common.future.AbstractSshFuture.lambda$notifyListener$3(AbstractSshFuture.java:178)
at
org.apache.sshd.common.util.threads.ThreadUtils.runAsInternal(ThreadUtils.java:64)
at
org.apache.sshd.common.future.AbstractSshFuture.notifyListener(AbstractSshFuture.java:177)
at
org.apache.sshd.common.future.DefaultSshFuture.addListener(DefaultSshFuture.java:214)
at
org.apache.sshd.common.session.helpers.AbstractSession.doKexNegotiation(AbstractSession.java:909)
at
org.apache.sshd.common.session.helpers.AbstractSession.handleKexInit(AbstractSession.java:868)
at
org.apache.sshd.common.session.helpers.AbstractSession.doHandleMessage(AbstractSession.java:597)
at
org.apache.sshd.common.session.helpers.AbstractSession.lambda$handleMessage$0(AbstractSession.java:546)
at
org.apache.sshd.common.util.threads.ThreadUtils.runAsInternal(ThreadUtils.java:68)
at
org.apache.sshd.common.session.helpers.AbstractSession.handleMessage(AbstractSession.java:545)
at
org.apache.sshd.common.session.helpers.AbstractSession.decode(AbstractSession.java:1729)
at
org.apache.sshd.common.session.helpers.AbstractSession.messageReceived(AbstractSession.java:506)
at
org.apache.sshd.common.session.helpers.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:64)
at
org.apache.sshd.common.io.nio2.Nio2Session.handleReadCycleCompletion(Nio2Session.java:409)
at
org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:382)
at
org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:377)
at
org.apache.sshd.common.io.nio2.Nio2CompletionHandler.lambda$completed$0(Nio2CompletionHandler.java:38)
at
java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
at
org.apache.sshd.common.io.nio2.Nio2CompletionHandler.completed(Nio2CompletionHandler.java:37)
at java.base/sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:129)
at java.base/sun.nio.ch.Invoker$2.run(Invoker.java:221)
at
java.base/sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:113)
at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
```
### Expected behavior
Ssh connection should be verified successfully.
### Relevant log output
```Shell
```
### Other information
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]