From 816169cacc18168cc0d457eb40e35c9f9d10c516 Mon Sep 17 00:00:00 2001 From: "Bansal, Nitin (nb121v)" Date: Thu, 3 Jan 2019 12:11:30 -0500 Subject: supporting clear text and obfuscated client cert supporting clear text and obfuscated client cert pwd Change-Id: I4278490aea41ae7b59fe9c0a0dc8ea1400155f6d Issue-ID: AAI-2046 Signed-off-by: Bansal, Nitin (nb121v) --- src/main/java/org/onap/crud/dao/DataRouterDAO.java | 3 ++- src/main/java/org/onap/crud/dao/champ/ChampDao.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/onap/crud/dao/DataRouterDAO.java b/src/main/java/org/onap/crud/dao/DataRouterDAO.java index e5b6d5a..df57beb 100644 --- a/src/main/java/org/onap/crud/dao/DataRouterDAO.java +++ b/src/main/java/org/onap/crud/dao/DataRouterDAO.java @@ -29,9 +29,10 @@ import org.onap.crud.util.CrudServiceConstants; public class DataRouterDAO extends ChampDao { public DataRouterDAO(String url, String certPassword) { try { + String deobfuscatedCertPassword = certPassword.startsWith("OBF:")?Password.deobfuscate(certPassword):certPassword; client = new RestClient().authenticationMode(RestAuthenticationMode.SSL_CERT).validateServerHostname(false) .validateServerCertChain(false).clientCertFile(CrudServiceConstants.CRD_DATAROUTER_AUTH_FILE) - .clientCertPassword(Password.deobfuscate(certPassword)); + .clientCertPassword(Password.deobfuscate(deobfuscatedCertPassword)); baseObjectUrl = url + OBJECT_SUB_URL; baseRelationshipUrl = url + RELATIONSHIP_SUB_URL; diff --git a/src/main/java/org/onap/crud/dao/champ/ChampDao.java b/src/main/java/org/onap/crud/dao/champ/ChampDao.java index 8563807..e6fb161 100644 --- a/src/main/java/org/onap/crud/dao/champ/ChampDao.java +++ b/src/main/java/org/onap/crud/dao/champ/ChampDao.java @@ -74,9 +74,10 @@ public class ChampDao implements GraphDao { public ChampDao(String champUrl, String certPassword) { try { + String deobfuscatedCertPassword = certPassword.startsWith("OBF:")?Password.deobfuscate(certPassword):certPassword; client = new RestClient().authenticationMode(RestAuthenticationMode.SSL_CERT).validateServerHostname(false) .validateServerCertChain(false).clientCertFile(CrudServiceConstants.CRD_CHAMP_AUTH_FILE) - .clientCertPassword(Password.deobfuscate(certPassword)); + .clientCertPassword(Password.deobfuscate(deobfuscatedCertPassword)); baseObjectUrl = champUrl + OBJECT_SUB_URL; baseRelationshipUrl = champUrl + RELATIONSHIP_SUB_URL; -- cgit