X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Fmodelloader%2Frestclient%2FAaiRestClient.java;h=40aeacc0c79e9cb916a16d686abd3b0dd38190f4;hb=598c2469a004c50a1b29882e02e2fab7a8407d8b;hp=29c0c70e76395addeb7e04619900d507fb2c395c;hpb=19f034b2554895285f12979b0f36c1629f9af984;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 29c0c70..40aeacc 100644 --- a/src/main/java/org/onap/aai/modelloader/restclient/AaiRestClient.java +++ b/src/main/java/org/onap/aai/modelloader/restclient/AaiRestClient.java @@ -156,24 +156,19 @@ public class AaiRestClient { private RestClient setupClient() { RestClient restClient = new RestClient(); + restClient.validateServerHostname(false) + .validateServerCertChain(false) + .connectTimeoutMs(config.getClientConnectTimeoutMs()) + .readTimeoutMs(config.getClientReadTimeoutMs()); //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); + restClient + .clientCertFile(config.getAaiKeyStorePath()) + .clientCertPassword(config.getAaiKeyStorePassword()); // @formatter:on } - else { - restClient.validateServerHostname(false) - .validateServerCertChain(false) - .connectTimeoutMs(120000) - .readTimeoutMs(120000); - } if (useBasicAuth()) { restClient.authenticationMode(RestAuthenticationMode.SSL_BASIC);