summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Timoney <dt5972@att.com>2018-09-20 18:30:04 +0000
committerGerrit Code Review <gerrit@onap.org>2018-09-20 18:30:04 +0000
commit15ac6196f60ba08a7567139ab43c5c60aa2d1a1f (patch)
treea6f8ab28f40c367cf08f2315840012a1c731f26b
parent06d1a812c151523c885656c1608d0e53a6cadc10 (diff)
parent01058306bbd691ff507e2e0b7cc13848520b1a85 (diff)
Merge "naming ms - interface testing updates."
-rw-r--r--ms/neng/opt/etc/config/application-live.properties13
-rw-r--r--ms/neng/src/main/docker/startService.sh15
-rw-r--r--ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/PolicyFinderServiceImpl.java5
3 files changed, 28 insertions, 5 deletions
diff --git a/ms/neng/opt/etc/config/application-live.properties b/ms/neng/opt/etc/config/application-live.properties
index 23feb8de..1af9d48f 100644
--- a/ms/neng/opt/etc/config/application-live.properties
+++ b/ms/neng/opt/etc/config/application-live.properties
@@ -28,3 +28,16 @@ datasource.db.password=${neng_db_pass}
jpa.hibernate.ddl-auto=none
jpa.show-sql=true
hibernate.show_sql:true
+
+#Interface with policy manager
+policymgr.clientAuth=Basic ${pol_client_auth}
+policymgr.basicAuth=Basic ${pol_basic_auth}
+policymgr.url=${pol_url}
+policymgr.environment=${pol_env}
+policymgr.ecompRequestId=${pol_req_id}
+
+#Interface with A&AI
+aai.certPassword=${aai_cert_pass}
+aai.cert=${aai_cert_path}
+aai.uRIBase=${aai_uri}
+aai.fromAppId=namegen-mS
diff --git a/ms/neng/src/main/docker/startService.sh b/ms/neng/src/main/docker/startService.sh
index 2e3e454c..17f53ce5 100644
--- a/ms/neng/src/main/docker/startService.sh
+++ b/ms/neng/src/main/docker/startService.sh
@@ -19,11 +19,18 @@
touch /app.jar
APP_ARGS=-Dspring.profiles.active=${SPRING_PROFILE}
-APP_ARGS=${APP_ARGS}" -Dpolicymgr_url="${POLICYMGR_URL}" -Dinstar_aaf_enc_pass="${AAF_PASS_ENC}
-APP_ARGS=${APP_ARGS}" -Daai_cert_pass="${AAI_CERT_PASSWORD}" -Daai_uribase="${AAI_URI_BASE}
-APP_ARGS=${APP_ARGS}" -Dneng_db_user="${NENG_DB_USER}" -Dneng_db_pass="${NENG_DB_PASS}
-APP_ARGS=${APP_ARGS}" -Dneng_db_url="${NENG_DB_URL}
+APP_ARGS=${APP_ARGS}" -Dneng_db_user="${NENG_DB_USER}" -Dneng_db_pass="${NENG_DB_PASS}
+APP_ARGS=${APP_ARGS}" -Dneng_db_url="${NENG_DB_URL}
+APP_ARGS=${APP_ARGS}" -Dpol_client_auth="${POL_CLIENT_AUTH}
+APP_ARGS=${APP_ARGS}" -Dpol_basic_auth="${POL_BASIC_AUTH}
+APP_ARGS=${APP_ARGS}" -Dpol_url="${POL_URL}
+APP_ARGS=${APP_ARGS}" -Dpol_env="${POL_ENV}
+APP_ARGS=${APP_ARGS}" -Dpol_req_id="${POL_REQ_ID}
+APP_ARGS=${APP_ARGS}" -Daai_cert_pass="${AAI_CERT_PASS}
+APP_ARGS=${APP_ARGS}" -Daai_cert_path="${AAI_CERT_PATH}
+APP_ARGS=${APP_ARGS}" -Daai_uri="${AAI_URI}
APP_ARGS=${APP_ARGS}" -cp /opt/etc/config"
echo "APP_ARGS ="${APP_ARGS}
java -Djava.security.egd=file:/dev/./urandom ${APP_ARGS} -Xms1024m -Xmx1024m -jar /app.jar --spring.config.location=/opt/etc/config/ > /tmp/app.out 2> /tmp/app.err
+
diff --git a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/PolicyFinderServiceImpl.java b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/PolicyFinderServiceImpl.java
index 392567b7..e93675bf 100644
--- a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/PolicyFinderServiceImpl.java
+++ b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/PolicyFinderServiceImpl.java
@@ -27,7 +27,9 @@ import java.security.cert.X509Certificate;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
+import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSession;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.TrustStrategy;
import org.apache.http.impl.client.CloseableHttpClient;
@@ -142,7 +144,8 @@ public class PolicyFinderServiceImpl implements PolicyFinder {
TrustStrategy acceptingTrustStrategy = (X509Certificate[] chain, String authType) -> true;
SSLContext sslContext = org.apache.http.ssl.SSLContexts.custom()
.loadTrustMaterial(null, acceptingTrustStrategy).build();
- SSLConnectionSocketFactory csf = new SSLConnectionSocketFactory(sslContext);
+ HostnameVerifier verifier = (String arg0, SSLSession arg1) -> true;
+ SSLConnectionSocketFactory csf = new SSLConnectionSocketFactory(sslContext, verifier);
CloseableHttpClient httpClient = HttpClients.custom().setSSLSocketFactory(csf).build();
HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory();
requestFactory.setHttpClient(httpClient);