diff options
-rw-r--r-- | pom.xml | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/aai/rest/RestClientProducer.java | 12 |
2 files changed, 7 insertions, 7 deletions
@@ -119,7 +119,7 @@ limitations under the License. <dependency> <groupId>org.onap.aai</groupId> <artifactId>rest-client</artifactId> - <version>1.1.0</version> + <version>1.2.1</version> </dependency> <!-- End REST Client specific dependencies. --> <!-- testing --> diff --git a/src/main/java/org/onap/aai/rest/RestClientProducer.java b/src/main/java/org/onap/aai/rest/RestClientProducer.java index 4170525..5062018 100644 --- a/src/main/java/org/onap/aai/rest/RestClientProducer.java +++ b/src/main/java/org/onap/aai/rest/RestClientProducer.java @@ -27,6 +27,7 @@ import org.onap.aai.event.EventBusConsumer; import org.onap.aai.restclient.client.Headers; import org.onap.aai.restclient.client.OperationResult; import org.onap.aai.restclient.client.RestClient; +import org.onap.aai.restclient.enums.RestAuthenticationMode; import org.onap.aai.restclient.rest.HttpUtil; import org.onap.aai.cl.api.Logger; import org.onap.aai.cl.eelf.LoggerFactory; @@ -231,22 +232,21 @@ public class RestClientProducer extends DefaultProducer { private RestClient getRestClient() { if (restClient == null) { - - String keystoreFilename = endpoint.getEcompKeystore(); + String keystorePassword = endpoint.getEcompKeystorePassword(); String clientCertFilename = endpoint.getEcompClientCert(); if (logger.isDebugEnabled()) { logger.debug("Instantiating REST Client with client_cert=" + clientCertFilename - + " keystore=" + keystoreFilename + " keystorePassword=" + keystorePassword); + + " keystorePassword=" + keystorePassword); } String deobfuscatedCertPassword = keystorePassword.startsWith("OBF:")?Password.deobfuscate(keystorePassword):keystorePassword; // Create REST client for search service - restClient = new RestClient().validateServerHostname(false).validateServerCertChain(true) - .clientCertFile(clientCertFilename) - .clientCertPassword(deobfuscatedCertPassword).trustStore(keystoreFilename); + restClient = new RestClient().authenticationMode(RestAuthenticationMode.SSL_CERT).validateServerHostname(false) + .validateServerCertChain(false).clientCertFile(clientCertFilename) + .clientCertPassword(deobfuscatedCertPassword); } return restClient; |