aboutsummaryrefslogtreecommitdiffstats
path: root/datarouter-node/src
diff options
context:
space:
mode:
Diffstat (limited to 'datarouter-node/src')
-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
-rw-r--r--datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeUtilsTest.java2
-rw-r--r--datarouter-node/src/test/resources/node_test.properties6
-rw-r--r--datarouter-node/src/test/resources/org.onap.dmaap-dr-test-cert.jksbin3647 -> 0 bytes
-rw-r--r--datarouter-node/src/test/resources/org.onap.dmaap-dr.jksbin0 -> 3666 bytes
7 files changed, 22 insertions, 18 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
diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeUtilsTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeUtilsTest.java
index 2d87b8b9..2b64c013 100644
--- a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeUtilsTest.java
+++ b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeUtilsTest.java
@@ -79,7 +79,7 @@ public class NodeUtilsTest {
@Test
public void Given_Get_CanonicalName_Called_Valid_CN_Returned() {
- String canonicalName = NodeUtils.getCanonicalName("jks", "src/test/resources/org.onap.dmaap-dr-test-cert.jks", "WGxd2P6MDo*Bi4+UdzWs{?$8");
+ String canonicalName = NodeUtils.getCanonicalName("jks", "src/test/resources/org.onap.dmaap-dr.jks", "[V7pj(U*?Jzpsl0aZP?3hS;?");
Assert.assertEquals("dmaap-dr-node", canonicalName);
}
}
diff --git a/datarouter-node/src/test/resources/node_test.properties b/datarouter-node/src/test/resources/node_test.properties
index 9e0cd994..a4f1cbd2 100644
--- a/datarouter-node/src/test/resources/node_test.properties
+++ b/datarouter-node/src/test/resources/node_test.properties
@@ -63,10 +63,10 @@ KeyStoreType = jks
KeyStoreFile = 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 = 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
diff --git a/datarouter-node/src/test/resources/org.onap.dmaap-dr-test-cert.jks b/datarouter-node/src/test/resources/org.onap.dmaap-dr-test-cert.jks
deleted file mode 100644
index 2320dc9f..00000000
--- a/datarouter-node/src/test/resources/org.onap.dmaap-dr-test-cert.jks
+++ /dev/null
Binary files differ
diff --git a/datarouter-node/src/test/resources/org.onap.dmaap-dr.jks b/datarouter-node/src/test/resources/org.onap.dmaap-dr.jks
new file mode 100644
index 00000000..bcbbe999
--- /dev/null
+++ b/datarouter-node/src/test/resources/org.onap.dmaap-dr.jks
Binary files differ