X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Fmodelloader%2Frestclient%2FAaiRestClient.java;h=29c0c70e76395addeb7e04619900d507fb2c395c;hb=d132185f972de61328bef9d511b875c0eefd9b1c;hp=27db74106b4c12e111c61fb8f9e4f191540dd44b;hpb=c5aea4a8bc398fc1c6220875e55b9520fd7f7524;p=aai%2Fmodel-loader.git diff --git a/src/main/java/org/onap/aai/modelloader/restclient/AaiRestClient.java b/src/main/java/org/onap/aai/modelloader/restclient/AaiRestClient.java index 27db741..29c0c70 100644 --- a/src/main/java/org/onap/aai/modelloader/restclient/AaiRestClient.java +++ b/src/main/java/org/onap/aai/modelloader/restclient/AaiRestClient.java @@ -157,12 +157,23 @@ public class AaiRestClient { private RestClient setupClient() { RestClient restClient = new RestClient(); - // @formatter:off - restClient.validateServerHostname(false) - .validateServerCertChain(false) - .clientCertFile(config.getAaiKeyStorePath()) - .clientCertPassword(config.getAaiKeyStorePassword()); - // @formatter:on + //Use certs only if SSL is enabled + if (config.useHttpsWithAAI()) + {// @formatter:off + restClient.validateServerHostname(false) + .validateServerCertChain(false) + .clientCertFile(config.getAaiKeyStorePath()) + .clientCertPassword(config.getAaiKeyStorePassword()) + .connectTimeoutMs(120000) + .readTimeoutMs(120000); + // @formatter:on + } + else { + restClient.validateServerHostname(false) + .validateServerCertChain(false) + .connectTimeoutMs(120000) + .readTimeoutMs(120000); + } if (useBasicAuth()) { restClient.authenticationMode(RestAuthenticationMode.SSL_BASIC);