Fix SslHandler indirection
[netconf.git] / apps / netconf-topology / src / main / java / org / opendaylight / netconf / topology / spi / NetconfClientConfigurationBuilderFactoryImpl.java
index 1e9ef1e57fec97788fed7abce442c5abe607a636..1df8b9450d80b0cb50c2dce4f7e134845a691a6d 100644 (file)
@@ -91,9 +91,9 @@ public final class NetconfClientConfigurationBuilderFactoryImpl implements Netco
             builder.withProtocol(NetconfClientProtocol.SSH);
             setSshParametersFromCredentials(builder, node.getCredentials());
         } else if (protocol.getName() == Name.TLS) {
-            builder.withProtocol(NetconfClientProtocol.TLS).withSslHandlerFactory(
-                channel -> sslHandlerFactoryProvider.getSslHandlerFactory(protocol.getSpecification())
-                    .createSslHandler());
+            final var handlerFactory = sslHandlerFactoryProvider.getSslHandlerFactory(protocol.getSpecification());
+            builder.withProtocol(NetconfClientProtocol.TLS)
+                .withSslHandlerFactory(channel -> handlerFactory.createSslHandler());
         } else {
             throw new IllegalArgumentException("Unsupported protocol type: " + protocol.getName());
         }