aboutsummaryrefslogtreecommitdiffstats
path: root/prh-aai-client/src/main/java
diff options
context:
space:
mode:
authorwasala <przemyslaw.wasala@nokia.com>2018-10-16 10:36:59 +0200
committerwasala <przemyslaw.wasala@nokia.com>2018-10-16 10:40:58 +0200
commitbb31441a6f401a0c819cb8158be85bf51cdfd405 (patch)
tree9405064cff48ac4878ddeb506f24181a947f3c31 /prh-aai-client/src/main/java
parent00c3ed839d7e46f991a7d7948eab142d6bb9b699 (diff)
CLM SCAN VULNERABILITIES
*Upgraded Spring from 5.0.5 -> 5.1.0i *Changed implementation of SSL in AAICLient Change-Id: I1341c19931031da67c2d0deb14940a2748b0203b Issue-ID: DCAEGEN2-870 Signed-off-by: wasala <przemyslaw.wasala@nokia.com>
Diffstat (limited to 'prh-aai-client/src/main/java')
-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())