Skip to content

Commit af750e7

Browse files
committed
Update plugin and dependencies versions
* And update GradleWrapper to 7.0.2 * And fix deprecation warning in WebClientConfig for HttpClient#from call
1 parent 2836c66 commit af750e7

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
id 'org.springframework.boot' version '2.4.5'
44
// id 'org.springframework.experimental.aot' version '0.9.2'
55
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
6-
id 'com.github.ben-manes.versions' version '0.38.0'
6+
id 'com.github.ben-manes.versions' version '0.39.0'
77
id 'io.franzbecker.gradle-lombok' version '4.0.0'
88
id 'java'
99
id 'jacoco'
@@ -49,7 +49,7 @@ repositories {
4949

5050
ext {
5151
set('springCloudServicesVersion', '3.2.1.RELEASE')
52-
set('springCloudVersion', '2020.0.2')
52+
set('springCloudVersion', '2020.0.3')
5353
set('spring-cloud-services-connectors.version', '3.2.1.RELEASE')
5454
}
5555

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip

src/main/java/io/pivotal/cfapp/config/WebClientConfig.java

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import io.netty.handler.ssl.SslContextBuilder;
1414
import io.netty.handler.ssl.util.InsecureTrustManagerFactory;
1515
import reactor.netty.http.client.HttpClient;
16-
import reactor.netty.tcp.TcpClient;
1716

1817
@RefreshScope
1918
@Configuration
@@ -24,22 +23,14 @@ public class WebClientConfig {
2423
@Bean
2524
@ConditionalOnProperty(name = "cf.sslValidationSkipped", havingValue="true")
2625
public WebClient insecureWebClient(WebClient.Builder builder) throws SSLException {
27-
SslContext sslContext =
28-
SslContextBuilder
29-
.forClient()
30-
.trustManager(InsecureTrustManagerFactory.INSTANCE)
31-
.build();
32-
TcpClient tcpClient = TcpClient.create().secure(sslProviderBuilder -> sslProviderBuilder.sslContext(sslContext));
33-
HttpClient httpClient = HttpClient.from(tcpClient);
34-
return builder
35-
.clientConnector(new ReactorClientHttpConnector(httpClient))
36-
.build();
26+
SslContext context = SslContextBuilder.forClient().trustManager(InsecureTrustManagerFactory.INSTANCE).build();
27+
HttpClient httpClient = HttpClient.create().secure(t -> t.sslContext(context));
28+
return WebClient.builder().clientConnector(new ReactorClientHttpConnector(httpClient)).build();
3729
}
3830

3931
@Bean
4032
@ConditionalOnProperty(name = "cf.sslValidationSkipped", havingValue="false", matchIfMissing=true)
4133
public WebClient secureWebClient(WebClient.Builder builder) {
42-
return builder
43-
.build();
34+
return builder.build();
4435
}
45-
}
36+
}

0 commit comments

Comments
 (0)