File tree Expand file tree Collapse file tree 3 files changed +8
-17
lines changed
src/main/java/io/pivotal/cfapp/config Expand file tree Collapse file tree 3 files changed +8
-17
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ plugins {
3
3
id ' org.springframework.boot' version ' 2.4.5'
4
4
// id 'org.springframework.experimental.aot' version '0.9.2'
5
5
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'
7
7
id ' io.franzbecker.gradle-lombok' version ' 4.0.0'
8
8
id ' java'
9
9
id ' jacoco'
@@ -49,7 +49,7 @@ repositories {
49
49
50
50
ext {
51
51
set(' springCloudServicesVersion' , ' 3.2.1.RELEASE' )
52
- set(' springCloudVersion' , ' 2020.0.2 ' )
52
+ set(' springCloudVersion' , ' 2020.0.3 ' )
53
53
set(' spring-cloud-services-connectors.version' , ' 3.2.1.RELEASE' )
54
54
}
55
55
Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
3
3
distributionPath =wrapper/dists
4
4
zipStoreBase =GRADLE_USER_HOME
5
5
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
Original file line number Diff line number Diff line change 13
13
import io .netty .handler .ssl .SslContextBuilder ;
14
14
import io .netty .handler .ssl .util .InsecureTrustManagerFactory ;
15
15
import reactor .netty .http .client .HttpClient ;
16
- import reactor .netty .tcp .TcpClient ;
17
16
18
17
@ RefreshScope
19
18
@ Configuration
@@ -24,22 +23,14 @@ public class WebClientConfig {
24
23
@ Bean
25
24
@ ConditionalOnProperty (name = "cf.sslValidationSkipped" , havingValue ="true" )
26
25
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 ();
37
29
}
38
30
39
31
@ Bean
40
32
@ ConditionalOnProperty (name = "cf.sslValidationSkipped" , havingValue ="false" , matchIfMissing =true )
41
33
public WebClient secureWebClient (WebClient .Builder builder ) {
42
- return builder
43
- .build ();
34
+ return builder .build ();
44
35
}
45
- }
36
+ }
You can’t perform that action at this time.
0 commit comments