diff options
author | 2018-11-08 16:29:04 -0600 | |
---|---|---|
committer | 2018-11-08 16:29:10 -0600 | |
commit | b2925aafd63f031392a4a5d44e105d047af7eed2 (patch) | |
tree | 5be791b54c270cee2116b48578e6cd1088e1c1e6 /cadi/core/src/main/java/org/onap | |
parent | 07c721465a0cc40d8e215cf5411bfd825b2c6b13 (diff) |
Improve nonContainer Agent Config2.1.7
Issue-ID: AAF-619
Change-Id: I9ea4a5a7fb1d5006d50ffc70f0bc0f98812d1513
Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'cadi/core/src/main/java/org/onap')
3 files changed, 12 insertions, 8 deletions
diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java b/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java index 8467c7c6..97984b03 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java @@ -398,4 +398,8 @@ public class PropAccess implements Access { public void set(LogIt logit) { logIt = logit; } + + public String toString() { + return props.toString(); + } } diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java b/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java index 2f9de6cf..3d668c42 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java @@ -774,7 +774,7 @@ public class Config { Method meth = lcls.getMethod("create",String.class); locator = (Locator<URI>)meth.invoke(null,url); } catch (Exception e) { - access.log(Level.INIT, e); + access.log(Level.DEBUG, "(Not fatal) Cannot load by create(String)", e); } if (locator==null) { URI locatorURI = new URI(url); diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfo.java b/cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfo.java index bb9981bf..e3eb34be 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfo.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfo.java @@ -152,7 +152,9 @@ public class SecurityInfo { protected void initializeKeyManager() throws CadiException, IOException, NoSuchAlgorithmException, KeyStoreException, CertificateException, UnrecoverableKeyException { String keyStore = access.getProperty(Config.CADI_KEYSTORE, null); - if (keyStore != null && !new File(keyStore).exists()) { + if(keyStore==null) { + return; + } else if (!new File(keyStore).exists()) { throw new CadiException(keyStore + " does not exist"); } @@ -201,16 +203,14 @@ public class SecurityInfo { protected void initializeTrustManager() throws NoSuchAlgorithmException, CertificateException, IOException, KeyStoreException, CadiException { String trustStore = access.getProperty(Config.CADI_TRUSTSTORE, null); - if (trustStore != null && !new File(trustStore).exists()) { + if(trustStore==null) { + return; + } else if(!new File(trustStore).exists()) { throw new CadiException(trustStore + " does not exist"); } - if (trustStore == null) { - return; - } - String trustStorePasswd = access.getProperty(Config.CADI_TRUSTSTORE_PASSWORD, null); - trustStorePasswd = (trustStorePasswd == null) ? "changeit"/*defacto Java Trust Pass*/ : access.decrypt(trustStorePasswd, false); + trustStorePasswd = (trustStorePasswd == null ) ? "changeit"/*defacto Java Trust Pass*/ : access.decrypt(trustStorePasswd, false); TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(SSL_KEY_MANAGER_FACTORY_ALGORITHM); File file; |