Fix timeout issue when cert service is unavailable
authorTomasz Wrobel <tomasz.wrobel@nokia.com>
Thu, 19 Mar 2020 13:59:03 +0000 (14:59 +0100)
committerTomasz Wrobel <tomasz.wrobel@nokia.com>
Mon, 23 Mar 2020 08:00:55 +0000 (09:00 +0100)
Issue-ID: AAF-1107
Signed-off-by: Tomasz Wrobel <tomasz.wrobel@nokia.com>
Change-Id: I0fd5f2615345e9d018af766b665971b90de6c3a0

certServiceClient/src/main/java/org/onap/aaf/certservice/client/httpclient/CloseableHttpClientProvider.java

index ff29a14..5ad933f 100644 (file)
@@ -34,7 +34,11 @@ public class CloseableHttpClientProvider {
 
     public CloseableHttpClient getClient() {
         RequestConfig config =
-                RequestConfig.custom().setConnectionRequestTimeout(timeout).build();
+                RequestConfig.custom()
+                        .setConnectionRequestTimeout(timeout)
+                        .setConnectTimeout(timeout)
+                        .setSocketTimeout(timeout)
+                        .build();
         return HttpClientBuilder.create().setDefaultRequestConfig(config).build();
     }
 }