summaryrefslogtreecommitdiffstats
path: root/openecomp-be/backend
diff options
context:
space:
mode:
authorTomasz Pietruszkiewicz <tomasz.pietruszkiewicz@nokia.com>2021-01-21 08:40:48 +0100
committerTomasz Pietruszkiewicz <tomasz.pietruszkiewicz@nokia.com>2021-01-21 08:41:59 +0100
commit7ccd053b8fba4adb564677feabfecfb0f446559e (patch)
treed650711797b93de9b5cd936e7c92ce5f681a270b /openecomp-be/backend
parent7ca0d6eeda3be23506678eb7747b4bf0b7c62b41 (diff)
PNF CSAR onboarding still works if root CA is removed from SDC directory
Change-Id: I687c4b9e7e25ca254caefb1746ee6f0984a539a8 Issue-ID: SDC-3442 Signed-off-by: Tomasz Pietruszkiewicz <tomasz.pietruszkiewicz@nokia.com>
Diffstat (limited to 'openecomp-be/backend')
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManager.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManager.java
index 56d0142e3b..006af058bb 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManager.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManager.java
@@ -238,8 +238,12 @@ public class SecurityManager {
return new File(certDirLocation);
}
- private X509Certificate loadCertificate(File certFile) throws SecurityManagerException, FileNotFoundException {
- return loadCertificateFactory(new FileInputStream(certFile));
+ private X509Certificate loadCertificate(File certFile) throws SecurityManagerException {
+ try (FileInputStream fi = new FileInputStream(certFile)) {
+ return loadCertificateFactory(fi);
+ } catch(IOException e) {
+ throw new SecurityManagerException("Error during loading Certificate from file!", e);
+ }
}
private X509Certificate loadCertificate(X509CertificateHolder cert) {