Reuse NetconfClientBuilder in NetconfCallHomeServer 36/104136/1
authorPeter Suna <peter.suna@pantheon.tech>
Tue, 24 Jan 2023 12:18:07 +0000 (13:18 +0100)
committerPeter Suna <peter.suna@pantheon.tech>
Wed, 25 Jan 2023 09:39:34 +0000 (10:39 +0100)
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>
netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServerBuilder.java

index 2b14b76302f573d4cf0653a1a4fe8dd82d3900dc..136adf351a6c388ed855679e8b4fe22f81ab40f9 100644 (file)
@@ -15,6 +15,7 @@ import java.util.Optional;
 import java.util.concurrent.TimeUnit;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.netconf.client.NetconfClientSessionNegotiatorFactory;
+import org.opendaylight.netconf.nettyutil.handler.ssh.client.NetconfClientBuilder;
 import org.opendaylight.netconf.shaded.sshd.client.SshClient;
 
 public class NetconfCallHomeServerBuilder {
@@ -104,7 +105,7 @@ public class NetconfCallHomeServerBuilder {
     }
 
     private static SshClient defaultSshClient() {
-        return SshClient.setUpDefaultClient();
+        return new NetconfClientBuilder().build();
     }
 
     private static NetconfClientSessionNegotiatorFactory defaultNegotiationFactory() {