aboutsummaryrefslogtreecommitdiffstats
path: root/prh-aai-client/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'prh-aai-client/src/main')
-rw-r--r--prh-aai-client/src/main/java/org/onap/dcaegen2/services/prh/service/AaiReactiveWebClient.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/prh-aai-client/src/main/java/org/onap/dcaegen2/services/prh/service/AaiReactiveWebClient.java b/prh-aai-client/src/main/java/org/onap/dcaegen2/services/prh/service/AaiReactiveWebClient.java
index 0dfe1f9e..256aa3b9 100644
--- a/prh-aai-client/src/main/java/org/onap/dcaegen2/services/prh/service/AaiReactiveWebClient.java
+++ b/prh-aai-client/src/main/java/org/onap/dcaegen2/services/prh/service/AaiReactiveWebClient.java
@@ -35,7 +35,9 @@ import org.onap.dcaegen2.services.prh.config.AaiClientConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
+import org.springframework.http.client.reactive.ClientHttpConnector;
import org.springframework.http.client.reactive.ReactorClientHttpConnector;
+import org.springframework.http.client.reactive.ReactorResourceFactory;
import org.springframework.web.reactive.function.client.ExchangeFilterFunction;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;
@@ -68,18 +70,15 @@ public class AaiReactiveWebClient {
* @return WebClient
*/
public WebClient build() throws SSLException {
- SslContext sslContext;
- sslContext = SslContextBuilder
+ LOGGER.debug("Setting ssl context");
+ SslContext sslContext = SslContextBuilder
.forClient()
.trustManager(InsecureTrustManagerFactory.INSTANCE)
.build();
- LOGGER.debug("Setting ssl context");
-
+ ClientHttpConnector reactorClientHttpConnector = new ReactorClientHttpConnector(new ReactorResourceFactory(),
+ httpClient -> httpClient.secure(sslContextSpec -> sslContextSpec.sslContext(sslContext)));
return WebClient.builder()
- .clientConnector(new ReactorClientHttpConnector(clientOptions -> {
- clientOptions.sslContext(sslContext);
- clientOptions.disablePool();
- }))
+ .clientConnector(reactorClientHttpConnector)
.defaultHeaders(httpHeaders -> httpHeaders.setAll(aaiHeaders))
.filter(basicAuthentication(aaiUserName, aaiUserPassword))
.filter(logRequest())