From dc9232b50a286b08d775ce6471697b53d9b483ce Mon Sep 17 00:00:00 2001 From: ezhil Date: Fri, 24 Apr 2020 18:04:04 +0530 Subject: Critical Sonar bug fix Sonar critical bug fix in HttpsAuthClient Issue-ID: AAF-1120 Change-Id: I840d7d4ac56767fd56f687f850bec879a4edeca9 Signed-off-by: ezhil --- aai-core/src/main/java/org/onap/aai/util/HttpsAuthClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aai-core/src/main/java/org/onap/aai/util/HttpsAuthClient.java b/aai-core/src/main/java/org/onap/aai/util/HttpsAuthClient.java index c2bfabf4..84935cdb 100644 --- a/aai-core/src/main/java/org/onap/aai/util/HttpsAuthClient.java +++ b/aai-core/src/main/java/org/onap/aai/util/HttpsAuthClient.java @@ -93,9 +93,9 @@ public class HttpsAuthClient { ctx = SSLContext.getInstance("TLSv1.2"); KeyManagerFactory kmf = null; - try { + + try(FileInputStream fin = new FileInputStream(keystorePath)) { kmf = KeyManagerFactory.getInstance("SunX509"); - FileInputStream fin = new FileInputStream(keystorePath); KeyStore ks = KeyStore.getInstance("PKCS12"); char[] pwd = keystorePassword.toCharArray(); ks.load(fin, pwd); -- cgit 1.2.3-korg