From 82b27ff5bccc925fe03d05f259cf881fafc8a1ce Mon Sep 17 00:00:00 2001 From: Piotr Jaszczyk Date: Fri, 15 Feb 2019 12:59:26 +0100 Subject: Use SDK/SSL in HV-VES Issue-ID: DCAEGEN2-1226 Change-Id: I7cfc09001f7315c1b6f4fcf150ad631630c810ef Signed-off-by: Piotr Jaszczyk --- .../kotlin/org/onap/dcae/collectors/veshv/factory/ServerFactory.kt | 4 ++-- .../org/onap/dcae/collectors/veshv/impl/adapters/HttpAdapter.kt | 1 - .../org/onap/dcae/collectors/veshv/impl/socket/NettyTcpServer.kt | 7 +++---- 3 files changed, 5 insertions(+), 7 deletions(-) (limited to 'sources/hv-collector-core') diff --git a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/factory/ServerFactory.kt b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/factory/ServerFactory.kt index 2e6bb4dc..31c06364 100644 --- a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/factory/ServerFactory.kt +++ b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/factory/ServerFactory.kt @@ -24,7 +24,7 @@ import org.onap.dcae.collectors.veshv.boundary.Metrics import org.onap.dcae.collectors.veshv.boundary.Server import org.onap.dcae.collectors.veshv.impl.socket.NettyTcpServer import org.onap.dcae.collectors.veshv.model.ServerConfiguration -import org.onap.dcae.collectors.veshv.ssl.boundary.ServerSslContextFactory +import org.onap.dcae.collectors.veshv.ssl.boundary.SslContextFactory /** * @author Piotr Jaszczyk @@ -34,5 +34,5 @@ object ServerFactory { fun createNettyTcpServer(serverConfiguration: ServerConfiguration, collectorProvider: CollectorProvider, metrics: Metrics): Server = - NettyTcpServer(serverConfiguration, ServerSslContextFactory(), collectorProvider, metrics) + NettyTcpServer(serverConfiguration, SslContextFactory(), collectorProvider, metrics) } diff --git a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/HttpAdapter.kt b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/HttpAdapter.kt index 51f7410b..8d154091 100644 --- a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/HttpAdapter.kt +++ b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/HttpAdapter.kt @@ -22,7 +22,6 @@ package org.onap.dcae.collectors.veshv.impl.adapters import io.netty.handler.codec.http.HttpStatusClass import org.onap.dcae.collectors.veshv.utils.logging.Logger import org.onap.dcae.collectors.veshv.utils.logging.OnapMdc -import org.slf4j.LoggerFactory import reactor.core.publisher.Mono import reactor.netty.http.client.HttpClient import java.util.* diff --git a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/socket/NettyTcpServer.kt b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/socket/NettyTcpServer.kt index 0d07d167..16edb55f 100644 --- a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/socket/NettyTcpServer.kt +++ b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/socket/NettyTcpServer.kt @@ -19,7 +19,6 @@ */ package org.onap.dcae.collectors.veshv.impl.socket -import arrow.core.Try import arrow.core.getOrElse import arrow.effects.IO import org.onap.dcae.collectors.veshv.boundary.Collector @@ -31,7 +30,7 @@ import org.onap.dcae.collectors.veshv.impl.adapters.ClientContextLogging.info import org.onap.dcae.collectors.veshv.model.ClientContext import org.onap.dcae.collectors.veshv.model.ServerConfiguration import org.onap.dcae.collectors.veshv.model.ServiceContext -import org.onap.dcae.collectors.veshv.ssl.boundary.ServerSslContextFactory +import org.onap.dcae.collectors.veshv.ssl.boundary.SslContextFactory import org.onap.dcae.collectors.veshv.utils.NettyServerHandle import org.onap.dcae.collectors.veshv.utils.ServerHandle import org.onap.dcae.collectors.veshv.utils.logging.Logger @@ -50,7 +49,7 @@ import java.time.Duration * @since May 2018 */ internal class NettyTcpServer(private val serverConfig: ServerConfiguration, - private val sslContextFactory: ServerSslContextFactory, + private val sslContextFactory: SslContextFactory, private val collectorProvider: CollectorProvider, private val metrics: Metrics) : Server { @@ -68,7 +67,7 @@ internal class NettyTcpServer(private val serverConfig: ServerConfiguration, private fun TcpServer.configureSsl() = sslContextFactory - .createSslContext(serverConfig.securityConfiguration) + .createServerContext(serverConfig.securityConfiguration) .map { sslContext -> logger.info { "Collector configured with SSL enabled" } this.secure { b -> b.sslContext(sslContext) } -- cgit 1.2.3-korg