diff options
author | Bansal, Nitin (nb121v) <nitin.bansal@amdocs.com> | 2019-01-03 12:11:30 -0500 |
---|---|---|
committer | Bansal, Nitin (nb121v) <nitin.bansal@amdocs.com> | 2019-01-03 12:22:53 -0500 |
commit | 816169cacc18168cc0d457eb40e35c9f9d10c516 (patch) | |
tree | b7d92699b649a26d03109f6a407ea05c482a130d /src/main/java | |
parent | 995c51941dbc80a69bdc01ea56c86219d3c73eaf (diff) |
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) <nitin.bansal@amdocs.com>
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/onap/crud/dao/DataRouterDAO.java | 3 | ||||
-rw-r--r-- | src/main/java/org/onap/crud/dao/champ/ChampDao.java | 3 |
2 files changed, 4 insertions, 2 deletions
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; |