Merge "Critical Sonar bug fix"
authorWilliam Reehil <william.reehil@att.com>
Mon, 6 Jul 2020 17:57:54 +0000 (17:57 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 6 Jul 2020 17:57:54 +0000 (17:57 +0000)
aai-core/src/main/java/org/onap/aai/util/HttpsAuthClient.java

index c2bfabf..84935cd 100644 (file)
@@ -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);