Skip to content

Commit 306f2d8

Browse files
committed
Polishing.
Move off deprecated Reactor Netty API. See gh-654
1 parent 53d48ae commit 306f2d8

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

spring-vault-core/src/main/java/org/springframework/vault/client/ClientHttpConnectorFactory.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import io.netty.channel.ChannelOption;
2323
import io.netty.handler.ssl.SslContextBuilder;
2424
import org.eclipse.jetty.util.ssl.SslContextFactory;
25+
import reactor.netty.http.Http11SslContextSpec;
2526
import reactor.netty.http.client.HttpClient;
2627

2728
import org.springframework.http.client.reactive.ClientHttpConnector;
@@ -130,17 +131,14 @@ static ClientHttpConnector usingReactorNetty(ClientOptions options, SslConfigura
130131

131132
if (hasSslConfiguration(sslConfiguration)) {
132133

133-
SslContextBuilder sslContextBuilder = SslContextBuilder.forClient();
134-
configureSsl(sslConfiguration, sslContextBuilder);
134+
Http11SslContextSpec sslContextSpec = Http11SslContextSpec.forClient()
135+
.configure(it -> configureSsl(sslConfiguration, it)).get();
135136

136-
client = client.secure(builder -> {
137-
builder.sslContext(sslContextBuilder);
138-
});
137+
client = client.secure(builder -> builder.sslContext(sslContextSpec));
139138
}
140139

141-
client = client.tcpConfiguration(it -> it.option(ChannelOption.CONNECT_TIMEOUT_MILLIS,
142-
Math.toIntExact(options.getConnectionTimeout().toMillis())))
143-
.proxyWithSystemProperties();
140+
client = client.option(ChannelOption.CONNECT_TIMEOUT_MILLIS,
141+
Math.toIntExact(options.getConnectionTimeout().toMillis())).proxyWithSystemProperties();
144142

145143
return new ReactorClientHttpConnector(client);
146144
}

0 commit comments

Comments
 (0)