<type>xml</type>
<classifier>features</classifier>
</dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>netconf-ssh</artifactId>
- <version>${project.version}</version>
- </dependency>
</dependencies>
</project>
<relativePath>../netconf-parent</relativePath>
</parent>
- <groupId>org.opendaylight.netconf</groupId>
<artifactId>mdsal-netconf-ssh</artifactId>
<version>1.6.0-SNAPSHOT</version>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>netconf-ssh</artifactId>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>org.apache.aries.blueprint</groupId>
<artifactId>org.apache.aries.blueprint.core</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991-ietf-inet-types</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>netconf-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>netconf-auth</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>netconf-util</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>netconf-netty-util</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ </dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Embed-Dependency>netconf-ssh</Embed-Dependency>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
</project>
private final int idleTimeout;
private final Optional<PublickeyAuthenticator> publickeyAuthenticator;
- SshProxyServerConfiguration(final InetSocketAddress bindingAddress, final LocalAddress localAddress,
- final AuthProvider authenticator, final KeyPairProvider keyPairProvider, final int idleTimeout) {
- this(bindingAddress, localAddress, authenticator, null, keyPairProvider, idleTimeout);
- }
-
SshProxyServerConfiguration(final InetSocketAddress bindingAddress, final LocalAddress localAddress,
final AuthProvider authenticator, final PublickeyAuthenticator publickeyAuthenticator,
final KeyPairProvider keyPairProvider, final int idleTimeout) {
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
-
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0 which accompanies this distribution,
- and is available at http://www.eclipse.org/legal/epl-v10.html
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.opendaylight.netconf</groupId>
- <artifactId>netconf-parent</artifactId>
- <version>1.6.0-SNAPSHOT</version>
- <relativePath>../netconf-parent</relativePath>
- </parent>
-
- <groupId>org.opendaylight.netconf</groupId>
- <artifactId>netconf-ssh</artifactId>
- <version>1.6.0-SNAPSHOT</version>
- <name>${project.artifactId}</name>
- <packaging>bundle</packaging>
-
- <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>netconf-api</artifactId>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>netconf-auth</artifactId>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>netconf-util</artifactId>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>netconf-impl</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
- <artifactId>rfc6991-ietf-inet-types</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>mockito-configuration</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>netconf-netty-util</artifactId>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>netconf-client</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>test-jar</goal>
- </goals>
- <phase>package</phase>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.netconf.ssh;
-
-import io.netty.channel.local.LocalAddress;
-import io.netty.channel.nio.NioEventLoopGroup;
-import java.io.File;
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import org.apache.sshd.common.util.security.SecurityUtils;
-import org.apache.sshd.common.util.threads.ThreadUtils;
-import org.apache.sshd.server.keyprovider.AbstractGeneratorHostKeyProvider;
-import org.opendaylight.netconf.auth.AuthProvider;
-import org.opendaylight.netconf.util.NetconfConfiguration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NetconfSSHProvider {
- private static final Logger LOG = LoggerFactory.getLogger(NetconfSSHProvider.class);
-
- private static final java.lang.String ALGORITHM = "RSA";
- private static final int KEY_SIZE = 4096;
- public static final int POOL_SIZE = 8;
- private static final int DEFAULT_IDLE_TIMEOUT = Integer.MAX_VALUE;
-
- private final AuthProvider authProvider;
- private final NetconfConfiguration netconfConfiguration;
-
- private ScheduledExecutorService minaTimerExecutor;
- private NioEventLoopGroup clientGroup;
- private ExecutorService nioExecutor;
-
- private SshProxyServer server;
-
- public NetconfSSHProvider(final AuthProvider authProvider,
- final NetconfConfiguration netconfConfiguration) {
-
- this.authProvider = authProvider;
- this.netconfConfiguration = netconfConfiguration;
- }
-
- // Called via blueprint
- @SuppressWarnings("unused")
- public void init() throws IOException {
- minaTimerExecutor = Executors.newScheduledThreadPool(POOL_SIZE,
- runnable -> new Thread(runnable, "netconf-ssh-server-mina-timers"));
- clientGroup = new NioEventLoopGroup();
- nioExecutor = ThreadUtils.newFixedThreadPool("netconf-ssh-server-nio-group", POOL_SIZE);
- server = startSSHServer();
- }
-
- // Called via blueprint
- @SuppressWarnings("unused")
- public void destroy() throws IOException {
- if (server != null) {
- server.close();
- }
-
- if (nioExecutor != null) {
- nioExecutor.shutdownNow();
- }
-
- if (clientGroup != null) {
- clientGroup.shutdownGracefully();
- }
-
- if (minaTimerExecutor != null) {
- minaTimerExecutor.shutdownNow();
- }
- }
-
- private SshProxyServer startSSHServer()
- throws IOException {
-
- final InetSocketAddress sshSocketAddress = netconfConfiguration.getSshServerAddress();
- LOG.info("Starting netconf SSH server at {}", sshSocketAddress);
-
- final LocalAddress localAddress = NetconfConfiguration.NETCONF_LOCAL_ADDRESS;
-
- final String path = netconfConfiguration.getPrivateKeyPath();
- LOG.trace("Starting netconf SSH server with path to ssh private key {}", path);
-
- final SshProxyServer sshProxyServer = new SshProxyServer(minaTimerExecutor, clientGroup, nioExecutor);
- final AbstractGeneratorHostKeyProvider keyPairProvider = SecurityUtils.createGeneratorHostKeyProvider(null);
- keyPairProvider.setAlgorithm(ALGORITHM);
- keyPairProvider.setKeySize(KEY_SIZE);
- keyPairProvider.setFile(new File(path));
- sshProxyServer.bind(
- new SshProxyServerConfigurationBuilder()
- .setBindingAddress(sshSocketAddress)
- .setLocalAddress(localAddress)
- .setAuthenticator(authProvider)
- .setKeyPairProvider(keyPairProvider)
- .setIdleTimeout(DEFAULT_IDLE_TIMEOUT)
- .createSshProxyServerConfiguration());
- return sshProxyServer;
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2017 Inocybe Technologies Inc. and others. All rights reserved.
-
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0 which accompanies this distribution,
- and is available at http://www.eclipse.org/legal/epl-v10.html
--->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
- odl:use-default-for-reference-types="true">
-
- <reference id="authProvider"
- interface="org.opendaylight.netconf.auth.AuthProvider"
- odl:type="netconf-auth-provider" />
-
- <reference id="netconfConfiguration"
- interface="org.opendaylight.netconf.util.NetconfConfiguration" />
-
- <bean id="netconfSshProvider" class="org.opendaylight.netconf.ssh.NetconfSSHProvider"
- init-method="init" destroy-method="destroy">
- <argument ref="authProvider" />
- <argument ref="netconfConfiguration" />
- </bean>
-
-</blueprint>
+++ /dev/null
------BEGIN RSA PRIVATE KEY-----
-MIIEogIBAAKCAQEAuC9hbEacpewvylI0mwFwjy3Wou2hpr/ncN9BBiFDSaG5yW2k
-3Oy+SCAcFCL+ZKWb6cc6Ch4gUeCwyEHRojZguuhliKtak9YQf6qbvpPLe00842Lx
-iqNAGurMpzizCDsGFq8ChaAkBZQI3TvcHuPoSUWSMJ+K8xHpRyUdVr6g2yEjezKJ
-sTXBtWaeCCh6YUafFujuDJk7fvYcPW7Je5KRBBStIKvxcMW0zB+7eq04deTHwGbJ
-gGjKWilQ72hsDDP3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D/sCAWW/lG13orw6ZL6FIroF1PJ3ILOkY
-CZN3hJF7TtKwpCWhZB2OfWzL2AGEkE8mUP0j/Q/5DCd6f6f0OSvOw3bfq6cm3iB5
-lP2ZAoGAXsRN5TZTX4AQ2xTlrDQ8A5XgcvyWQpJOmEXMTyHV7VaJVzmNWFVAvndK
-5UIq8ALDwB2t7vjmMUW6euvIwqtXiop7G79UOb3e3NhzeyWFGQyBLqCRznGaXQTT
-dlFy73xhukZMhFnj006bjKCYvOPnwuGl3+0fuWil5Rq3jOuY5c8=
------END RSA PRIVATE KEY-----
+++ /dev/null
-<configuration>
-
- <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <pattern>%date{"yyyy-MM-dd HH:mm:ss.SSS z"} [%thread] %-5level %logger{36} - %msg%n</pattern>
- </encoder>
- </appender>
-
- <root level="error">
- <appender-ref ref="STDOUT" />
- </root>
- <logger name="org.opendaylight.controller.netconf" level="TRACE"/>
-</configuration>
<module>netconf-netty-util</module>
<module>netconf-mapping-api</module>
<module>netconf-client</module>
- <module>netconf-ssh</module>
<module>netconf-tcp</module>
<module>netconf-auth</module>
<module>aaa-authn-odl-plugin</module>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>mdsal-netconf-monitoring</artifactId>
</dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>netconf-ssh</artifactId>
- </dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-dom-inmemory-datastore</artifactId>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>mdsal-netconf-connector</artifactId>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>mdsal-netconf-ssh</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.karaf.features</groupId>
<artifactId>org.apache.karaf.features.core</artifactId>