aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-03-19 11:51:59 -0400
committerJim Hahn <jrh3@att.com>2021-03-19 11:52:21 -0400
commit43c05f435510137c8e241c3c6d24b562f1244403 (patch)
tree38637f764dc2d7a35f8091a04c2dd2bd6718fcf3 /main
parent6fcbc2d8ef53fc2de3cdbc33e84402be5e890d0b (diff)
Delete keystores from pap
The Keystore is no longer needed in the tarball, as it is supplied externally by the CSITs and Helm charts. Deleted that file. Also modified the junits to use utils-test to generates keystores at runtime, thus deleted the junit keystore file, too. Issue-ID: POLICY-3143 Change-Id: I2b0c4868613e0923aad87844dd16f3ac236d4291 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'main')
-rw-r--r--main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java11
-rw-r--r--main/src/test/resources/ssl/policy-keystorebin4431 -> 0 bytes
2 files changed, 6 insertions, 5 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java b/main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java
index 3823365b..c0a69515 100644
--- a/main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java
+++ b/main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java
@@ -1,7 +1,7 @@
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property.
+ * Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -47,6 +47,7 @@ import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
import org.onap.policy.common.gson.GsonMessageBodyHandler;
import org.onap.policy.common.utils.network.NetworkUtil;
+import org.onap.policy.common.utils.security.SelfSignedKeyStore;
import org.onap.policy.common.utils.services.Registry;
import org.onap.policy.pap.main.PapConstants;
import org.onap.policy.pap.main.PolicyPapException;
@@ -68,14 +69,13 @@ public class CommonPapRestServer {
private static final Logger LOGGER = LoggerFactory.getLogger(CommonPapRestServer.class);
- private static String KEYSTORE = System.getProperty("user.dir") + "/src/test/resources/ssl/policy-keystore";
-
public static final String NOT_ALIVE = "not alive";
public static final String ALIVE = "alive";
public static final String SELF = NetworkUtil.getHostname();
public static final String NAME = "Policy PAP";
public static final String ENDPOINT_PREFIX = "policy/pap/v1/";
+ private static SelfSignedKeyStore keystore;
private static int port;
protected static String httpsPrefix;
@@ -101,6 +101,7 @@ public class CommonPapRestServer {
* @throws Exception if an error occurs
*/
public static void setUpBeforeClass(boolean shouldStart) throws Exception {
+ keystore = new SelfSignedKeyStore();
port = NetworkUtil.allocPort();
httpsPrefix = "https://localhost:" + port + "/";
@@ -196,8 +197,8 @@ public class CommonPapRestServer {
}
final Properties systemProps = System.getProperties();
- systemProps.put("javax.net.ssl.keyStore", KEYSTORE);
- systemProps.put("javax.net.ssl.keyStorePassword", "Pol1cy_0nap");
+ systemProps.put("javax.net.ssl.keyStore", keystore.getKeystoreName());
+ systemProps.put("javax.net.ssl.keyStorePassword", SelfSignedKeyStore.KEYSTORE_PASSWORD);
System.setProperties(systemProps);
final String[] papConfigParameters = { "-c", CONFIG_FILE };
diff --git a/main/src/test/resources/ssl/policy-keystore b/main/src/test/resources/ssl/policy-keystore
deleted file mode 100644
index b95e0103..00000000
--- a/main/src/test/resources/ssl/policy-keystore
+++ /dev/null
Binary files differ