diff options
author | grabinsk <maciej.grabinski@nokia.com> | 2019-05-15 12:49:47 +0200 |
---|---|---|
committer | grabinsk <maciej.grabinski@nokia.com> | 2019-05-15 15:35:58 +0200 |
commit | 4d53427075cf4e5deaee88d59bc4b9a03d2fc225 (patch) | |
tree | 695b7e67c230b86c706ee57ac549d8447293ed95 /rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/AaiHttpClientFactory.java | |
parent | 3f6de371dcd59126e2e7933d31f970391a1ad517 (diff) |
Fix loading of ssl keys from external files for dmaap and AAI client4.0.0-ONAP1.1.6dublin
Change-Id: I18a68656ddfc8290e17fb483900c26baf3e25ba6
Issue-ID: DCAEGEN2-1503
Signed-off-by: grabinsk <maciej.grabinski@nokia.com>
Diffstat (limited to 'rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/AaiHttpClientFactory.java')
-rw-r--r-- | rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/AaiHttpClientFactory.java | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/AaiHttpClientFactory.java b/rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/AaiHttpClientFactory.java index 9c097ef1..21d56c49 100644 --- a/rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/AaiHttpClientFactory.java +++ b/rest-services/aai-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/aai/client/service/AaiHttpClientFactory.java @@ -61,20 +61,16 @@ public class AaiHttpClientFactory { private SslContext createSslContext() { if (configuration.enableAaiCertAuth()) { final SecurityKeys collectorSecurityKeys = ImmutableSecurityKeys.builder() - .keyStore(ImmutableSecurityKeysStore.of(resource(configuration.keyStorePath()).get())) - .keyStorePassword(Passwords.fromResource(configuration.keyStorePasswordPath())) - .trustStore(ImmutableSecurityKeysStore.of(resource(configuration.trustStorePath()).get())) - .trustStorePassword(Passwords.fromResource(configuration.trustStorePasswordPath())) + .keyStore(ImmutableSecurityKeysStore.of(Paths.get(configuration.keyStorePath()))) + .keyStorePassword(Passwords.fromPath(Paths.get(configuration.keyStorePasswordPath()))) + .trustStore(ImmutableSecurityKeysStore.of(Paths.get(configuration.trustStorePath()))) + .trustStorePassword(Passwords.fromPath(Paths.get(configuration.trustStorePasswordPath()))) .build(); return sslFactory.createSecureClientContext(collectorSecurityKeys); } return sslFactory.createInsecureClientContext(); } - private Try<Path> resource(String resource) { - return Try.of(() -> Paths.get(Passwords.class.getResource(resource).toURI())); - } - public static RequestDiagnosticContext createRequestDiagnosticContext() { return ImmutableRequestDiagnosticContext.builder() .invocationId(UUID.randomUUID()).requestId(UUID.randomUUID()).build(); |