aboutsummaryrefslogtreecommitdiffstats
path: root/datarouter-node/src/main
diff options
context:
space:
mode:
authordavid.mcweeney <david.mcweeney@est.tech>2022-03-16 16:08:44 +0000
committerdavid.mcweeney <david.mcweeney@est.tech>2022-04-04 16:27:53 +0100
commitd70c2ca145d2b3eac7ed6a4f16d41e322962cf59 (patch)
treea71e61d38753a5b258b103f56a5ac3b19c6325eb /datarouter-node/src/main
parent9602193f94e88e8d82936ba36fc20203227a4eec (diff)
DMAAP-1714 - DR Making TLS Configurable
Change-Id: I0c3bc05182691c12c9d0f0b76d09f7dfea3e09eb Signed-off-by: david.mcweeney <david.mcweeney@est.tech> Issue-ID: DMAAP-1714
Diffstat (limited to 'datarouter-node/src/main')
-rw-r--r--datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeConfigManager.java7
-rw-r--r--datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeServlet.java2
-rw-r--r--datarouter-node/src/main/resources/node.properties3
3 files changed, 11 insertions, 1 deletions
diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeConfigManager.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeConfigManager.java
index 5b5245da..3b950232 100644
--- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeConfigManager.java
+++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeConfigManager.java
@@ -102,6 +102,7 @@ public class NodeConfigManager implements DeliveryQueueHelper {
private String aafType;
private String aafInstance;
private String aafAction;
+ private boolean tlsEnabled;
private boolean cadiEnabled;
private NodeAafPropsUtils nodeAafPropsUtils;
@@ -159,6 +160,8 @@ public class NodeConfigManager implements DeliveryQueueHelper {
svcport = Integer.parseInt(drNodeProperties.getProperty("IntHttpsPort", "8443"));
port = Integer.parseInt(drNodeProperties.getProperty("ExtHttpsPort", "443"));
spooldir = drNodeProperties.getProperty("SpoolDir", "spool");
+ tlsEnabled = Boolean.parseBoolean(drNodeProperties.getProperty("TlsEnabled", "true"));
+
File fdir = new File(spooldir + "/f");
fdir.mkdirs();
for (File junk : Objects.requireNonNull(fdir.listFiles())) {
@@ -811,6 +814,10 @@ public class NodeConfigManager implements DeliveryQueueHelper {
return aafAction;
}
+ protected boolean isTlsEnabled() {
+ return tlsEnabled;
+ }
+
boolean getCadiEnabled() {
return cadiEnabled;
}
diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeServlet.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeServlet.java
index 139c7492..ee1f5b7d 100644
--- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeServlet.java
+++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeServlet.java
@@ -549,7 +549,7 @@ public class NodeServlet extends HttpServlet {
eelfLogger.info(EelfMsgs.EXIT);
return null;
}
- if (!req.isSecure()) {
+ if (!req.isSecure() && config.isTlsEnabled()) {
eelfLogger.error(
"NODE0104 Rejecting insecure PUT or DELETE of " + req.getPathInfo() + FROM + req
.getRemoteAddr());
diff --git a/datarouter-node/src/main/resources/node.properties b/datarouter-node/src/main/resources/node.properties
index 1d7a5d42..f7c24fab 100644
--- a/datarouter-node/src/main/resources/node.properties
+++ b/datarouter-node/src/main/resources/node.properties
@@ -85,3 +85,6 @@ CadiEnabled = false
#
# AAF Props file path
AAFPropsFilePath = /opt/app/osaaf/local/org.onap.dmaap-dr.props
+
+# https security required for publish request
+TlsEnabled = true