summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/dcaegen2/services/pmmapper/App.java
diff options
context:
space:
mode:
authorTomasz Wrobel <tomasz.wrobel@nokia.com>2022-01-25 11:00:42 +0100
committerTomasz Wrobel <tomasz.wrobel@nokia.com>2022-02-11 12:27:06 +0100
commit9d02ea09cac22c177688622ed50a7eb3f6fd38ce (patch)
tree430c1dfc64d505a24a380d7eeef48d0f1c3d37db /src/main/java/org/onap/dcaegen2/services/pmmapper/App.java
parent6fa1dfca682711066189bef2f946433b614239fe (diff)
Fix loading SSL Context when certpaths not exist in configuration1.8.0
- Make cert paths field optional in configuration. - Allow to skip ssl context load. - Make PublisherConfig and SubscriberConfig fields optional. - Remove Auth Header when AAF credentials are empty Issue-ID: DCAEGEN2-3032 Issue-ID: DCAEGEN2-3038 Signed-off-by: Tomasz Wrobel <tomasz.wrobel@nokia.com> Change-Id: I27d44cf8c2887b3a75c5ad16f833439b7b5757ee
Diffstat (limited to 'src/main/java/org/onap/dcaegen2/services/pmmapper/App.java')
-rw-r--r--src/main/java/org/onap/dcaegen2/services/pmmapper/App.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/org/onap/dcaegen2/services/pmmapper/App.java b/src/main/java/org/onap/dcaegen2/services/pmmapper/App.java
index 0da2b7e..0c49a96 100644
--- a/src/main/java/org/onap/dcaegen2/services/pmmapper/App.java
+++ b/src/main/java/org/onap/dcaegen2/services/pmmapper/App.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
- * Copyright (C) 2021-2022 Nokia.
+ * Copyright (C) 2021-2022 Nokia. All rights reserved.
* Copyright (C) 2021 Samsung Electronics.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -169,7 +169,7 @@ public class App {
this.serverResources = Arrays.asList(healthCheckHandler, deliveryHandler, dynamicConfiguration);
try {
this.applicationServer = server(this.mapperConfig, this.serverResources);
- } catch (IOException e) {
+ } catch (IOException | MapperConfigException e ) {
logger.unwrap().error("Failed to create server instance.", e);
throw new IllegalStateException("Server instantiation failed");
}
@@ -194,7 +194,10 @@ public class App {
private Undertow server(MapperConfig config, List<ServerResource> serverResources) throws IOException {
SSLContextFactory sslContextFactory = new SSLContextFactory(config);
SSLContext sslContext = sslContextFactory.createSSLContext(config);
- SSLContext.setDefault(sslContext);
+ if (sslContext != null) {
+ SSLContext.setDefault(sslContext);
+ logger.unwrap().info("SSL Context loaded");
+ }
Undertow.Builder builder = Undertow.builder();
if (config.getEnableHttp()) {
builder.addHttpListener(this.httpPort, "0.0.0.0");