aboutsummaryrefslogtreecommitdiffstats
path: root/datarouter-node/src/main
diff options
context:
space:
mode:
authorefiacor <fiachra.corcoran@est.tech>2020-04-02 18:02:04 +0100
committerefiacor <fiachra.corcoran@est.tech>2020-04-02 18:19:17 +0100
commit2dfca3dc2f06f4e6319094bb006eff090178a8f1 (patch)
tree2a6655b5a1fe2814fd6cc9da90dcdda6d867e80b /datarouter-node/src/main
parent6c364bc626f9bd5eb6d5dedd84bd823c3c26f91d (diff)
New DR AAF certs for elalto branch2.2.0
Signed-off-by: efiacor <fiachra.corcoran@est.tech> Change-Id: I8459b64627eb79de37086dc061cf07e6dbac345f Issue-ID: DMAAP-1421
Diffstat (limited to 'datarouter-node/src/main')
-rw-r--r--datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeUtils.java20
-rw-r--r--datarouter-node/src/main/resources/drNodeCadi.properties6
-rw-r--r--datarouter-node/src/main/resources/node.properties6
3 files changed, 18 insertions, 14 deletions
diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeUtils.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeUtils.java
index d4fc7dbe..37e5db60 100644
--- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeUtils.java
+++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeUtils.java
@@ -47,6 +47,9 @@ import java.util.Enumeration;
import java.util.TimeZone;
import java.util.UUID;
import java.util.zip.GZIPInputStream;
+import javax.naming.InvalidNameException;
+import javax.naming.ldap.LdapName;
+import javax.naming.ldap.Rdn;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.codec.binary.Base64;
@@ -315,15 +318,16 @@ public class NodeUtils {
X509Certificate cert = (X509Certificate) ks.getCertificate(alias);
if (cert != null) {
String subject = cert.getSubjectX500Principal().getName();
- String[] parts = subject.split(",");
- if (parts.length < 1) {
- return null;
+ try {
+ LdapName ln = new LdapName(subject);
+ for (Rdn rdn : ln.getRdns()) {
+ if (rdn.getType().equalsIgnoreCase("CN")) {
+ return rdn.getValue().toString();
+ }
+ }
+ } catch (InvalidNameException e) {
+ eelfLogger.error("No valid CN not found for dr-node cert", e);
}
- subject = parts[5].trim();
- if (!subject.startsWith("CN=")) {
- return null;
- }
- return subject.substring(3);
}
}
return null;
diff --git a/datarouter-node/src/main/resources/drNodeCadi.properties b/datarouter-node/src/main/resources/drNodeCadi.properties
index 8dfcab1c..b94f6cfa 100644
--- a/datarouter-node/src/main/resources/drNodeCadi.properties
+++ b/datarouter-node/src/main/resources/drNodeCadi.properties
@@ -1,11 +1,11 @@
cadi_x509_issuers=CN=intermediateCA_1, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_7, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_9, OU=OSAAF, O=ONAP, C=US
cadi_keyfile=/opt/app/datartr/aaf_certs/org.onap.dmaap-dr.keyfile
cadi_keystore=/opt/app/datartr/aaf_certs/org.onap.dmaap-dr.jks
-cadi_keystore_password=]3V)($O&.Mv]W{f8^]6SxGNL
-cadi_key_password=]3V)($O&.Mv]W{f8^]6SxGNL
+cadi_keystore_password=[V7pj(U*?Jzpsl0aZP?3hS;?
+cadi_key_password=[V7pj(U*?Jzpsl0aZP?3hS;?
cadi_alias=dmaap-dr-node@dmaap-dr.onap.org
cadi_truststore=/opt/app/datartr/aaf_certs/org.onap.dmaap-dr.trust.jks
-cadi_truststore_password=(Rd,&{]%ePdp}4JZjqoJ2G+g
+cadi_truststore_password=jH+{FIhNOX+tl:I7:dnJT($3
aaf_env=DEV
aaf_locate_url=https://aaf-onap-test.osaaf.org:8095
diff --git a/datarouter-node/src/main/resources/node.properties b/datarouter-node/src/main/resources/node.properties
index 7c076359..5a669eca 100644
--- a/datarouter-node/src/main/resources/node.properties
+++ b/datarouter-node/src/main/resources/node.properties
@@ -63,10 +63,10 @@ KeyStoreType = jks
KeyStoreFile = /opt/app/datartr/aaf_certs/org.onap.dmaap-dr.jks
#
# The password for the https keystore
-KeyStorePassword=WGxd2P6MDo*Bi4+UdzWs{?$8
+KeyStorePassword=[V7pj(U*?Jzpsl0aZP?3hS;?
#
# The password for the private key in the https keystore
-KeyPassword=WGxd2P6MDo*Bi4+UdzWs{?$8
+KeyPassword=[V7pj(U*?Jzpsl0aZP?3hS;?
#
# The type of truststore for https
TrustStoreType = jks
@@ -75,7 +75,7 @@ TrustStoreType = jks
TrustStoreFile = /opt/app/datartr/aaf_certs/org.onap.dmaap-dr.trust.jks
#
# The password for the https truststore
-TrustStorePassword=)OBvCd{e{aWq.^mJJdX:S:1&
+TrustStorePassword=jH+{FIhNOX+tl:I7:dnJT($3
#
# The path to the file used to trigger an orderly shutdown
QuiesceFile = etc/SHUTDOWN