summaryrefslogtreecommitdiffstats
path: root/profiles
diff options
context:
space:
mode:
Diffstat (limited to 'profiles')
-rw-r--r--profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java b/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java
index 3e03efa7..235a3b98 100644
--- a/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java
+++ b/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java
@@ -126,7 +126,7 @@ public class OnapHttpConnection {
.register("https", new SSLConnectionSocketFactory(sslContext, hostnameVerifier)).build();
HttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry);
- this.httpClient = HttpClients.custom().setConnectionManager(connManager)
+ this.httpClient = HttpClients.custom().setConnectionManager(connManager) // NOSONAR
.setRedirectStrategy(new LaxRedirectStrategy()).build();
} else {
this.httpClient = HttpClients.createDefault(); // NOSONAR
@@ -345,8 +345,12 @@ public class OnapHttpConnection {
return result;
}
+ @SuppressWarnings("deprecation")
public void close() {
this.mapCommonHeaders.clear();
+ if (this.httpClient != null) {
+ this.httpClient.getConnectionManager().shutdown();
+ }
}
private HttpEntity getMultipartEntity(HttpInput input) {