aboutsummaryrefslogtreecommitdiffstats
path: root/rest-services/http-client
diff options
context:
space:
mode:
authorpwielebs <piotr.wielebski@nokia.com>2019-08-20 14:42:53 +0200
committerkjaniak <kornel.janiak@nokia.com>2019-11-27 14:20:09 +0100
commit01789096439b85ebb9d63633377a3603ef4a9535 (patch)
treeee52a2b22b3bf9c97298d80cc368cc61d9366f40 /rest-services/http-client
parent2f1cf71e142b1c3494bd4f652f3af2a296430b8f (diff)
Upgrade CBS java SDK to support SSL
- add TrustStoreKeys class for one-way TLS for CBS client - use trust.jks & trust.pass - add unit test - top up version of Vavr lib (due to bug) Issue-ID: DCAEGEN2-1552 Signed-off-by: Piotr Wielebski <piotr.wielebski@nokia.com> Change-Id: I372c559cce5db8eba5448d99e12cdf6609c40d00
Diffstat (limited to 'rest-services/http-client')
-rw-r--r--rest-services/http-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/adapters/http/RxHttpClientFactory.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/rest-services/http-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/adapters/http/RxHttpClientFactory.java b/rest-services/http-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/adapters/http/RxHttpClientFactory.java
index 1453adb9..9b23f1d9 100644
--- a/rest-services/http-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/adapters/http/RxHttpClientFactory.java
+++ b/rest-services/http-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/adapters/http/RxHttpClientFactory.java
@@ -24,6 +24,7 @@ import io.netty.handler.ssl.SslContext;
import org.jetbrains.annotations.NotNull;
import org.onap.dcaegen2.services.sdk.security.ssl.SecurityKeys;
import org.onap.dcaegen2.services.sdk.security.ssl.SslFactory;
+import org.onap.dcaegen2.services.sdk.security.ssl.TrustStoreKeys;
import reactor.netty.http.client.HttpClient;
/**
@@ -47,6 +48,11 @@ public final class RxHttpClientFactory {
return create(context);
}
+ public static RxHttpClient create(TrustStoreKeys trustStoreKeys) {
+ final SslContext context = SSL_FACTORY.createSecureClientContext(trustStoreKeys);
+ return create(context);
+ }
+
public static RxHttpClient createInsecure() {
final SslContext context = SSL_FACTORY.createInsecureClientContext();
return create(context);