diff options
Diffstat (limited to 'src/main/java/org/onap/aai/modelloader/restclient/AaiRestClient.java')
-rw-r--r-- | src/main/java/org/onap/aai/modelloader/restclient/AaiRestClient.java | 19 |
1 files changed, 7 insertions, 12 deletions
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); |