Reuse NetconfClientBuilder in NetconfCallHomeServer 54/104154/1
authorPeter Suna <peter.suna@pantheon.tech>
Tue, 24 Jan 2023 12:18:07 +0000 (13:18 +0100)
committerRobert Varga <nite@hq.sk>
Mon, 30 Jan 2023 14:56:50 +0000 (14:56 +0000)
To prevent issues with connecting to devices that
use old key exchange algorithms, use the default NetconfSshClient
inside the NetconfCallHomeServer.

JIRA: NETCONF-887
Change-Id: I379c26281dcec6df10dcdbe0ccbfa8c3bea7e8f0
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
(cherry picked from commit e3ad7c25673e9c59e750612c83adf73fdb1576a4)

netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServerBuilder.java

index 19d0c933a9841a55eb6120cc4554fa17582dbd60..856070c73351d2f5c6b816b0470491e3358ecbf1 100644 (file)
@@ -15,6 +15,7 @@ import java.util.Optional;
 import java.util.concurrent.TimeUnit;
 import org.opendaylight.netconf.callhome.protocol.CallHomeSessionContext.Factory;
 import org.opendaylight.netconf.client.NetconfClientSessionNegotiatorFactory;
+import org.opendaylight.netconf.nettyutil.handler.ssh.client.NetconfClientBuilder;
 import org.opendaylight.netconf.shaded.sshd.client.SshClient;
 import org.opendaylight.yangtools.concepts.Builder;
 
@@ -107,7 +108,7 @@ public class NetconfCallHomeServerBuilder implements Builder<NetconfCallHomeServ
     }
 
     private static SshClient defaultSshClient() {
-        return SshClient.setUpDefaultClient();
+        return new NetconfClientBuilder().build();
     }
 
     private static NetconfClientSessionNegotiatorFactory defaultNegotiationFactory() {