yu199195 commented on code in PR #3438:
URL: https://github.com/apache/incubator-shenyu/pull/3438#discussion_r884845779
##########
shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-httpclient/src/main/java/org/apache/shenyu/springboot/starter/plugin/httpclient/HttpClientPluginConfiguration.java:
##########
@@ -128,50 +134,75 @@ public HttpClient httpClient(final HttpClientProperties
properties,
}
private void setSsl(final SslProvider.SslContextSpec sslContextSpec, final
HttpClientProperties.Ssl ssl) {
- SslContextBuilder sslContextBuilder = SslContextBuilder.forClient();
- X509Certificate[] trustedX509Certificates =
ssl.getTrustedX509CertificatesForTrustManager();
- if (ArrayUtils.isNotEmpty(trustedX509Certificates)) {
- sslContextBuilder.trustManager(trustedX509Certificates);
- } else if (ssl.isUseInsecureTrustManager()) {
-
sslContextBuilder.trustManager(InsecureTrustManagerFactory.INSTANCE);
- }
- sslContextBuilder.keyManager(ssl.getKeyManagerFactory());
- sslContextSpec.sslContext(sslContextBuilder)
- .defaultConfiguration(ssl.getDefaultConfigurationType())
+ SslProvider.ProtocolSslContextSpec spec =
DefaultSslContextSpec.forClient()
+ .configure(sslContextBuilder -> {
+ X509Certificate[] trustedX509Certificates =
ssl.getTrustedX509CertificatesForTrustManager();
+ if (ArrayUtils.isNotEmpty(trustedX509Certificates)) {
+
sslContextBuilder.trustManager(trustedX509Certificates);
+ } else if (ssl.isUseInsecureTrustManager()) {
+
sslContextBuilder.trustManager(InsecureTrustManagerFactory.INSTANCE);
+ }
+ sslContextBuilder.keyManager(ssl.getKeyManagerFactory());
+
sslContextBuilder.sslProvider(ssl.getDefaultConfigurationType());
+ });
+ sslContextSpec.sslContext(spec)
.handshakeTimeout(ssl.getHandshakeTimeout())
.closeNotifyFlushTimeout(ssl.getCloseNotifyFlushTimeout())
.closeNotifyReadTimeout(ssl.getCloseNotifyReadTimeout());
}
- private TcpClient setTcpClientProxy(final TcpClient tcpClient, final
HttpClientProperties.Proxy proxy) {
Review Comment:
why remove this ?
##########
shenyu-spring-boot-starter/shenyu-spring-boot-starter-gateway/src/main/java/org/apache/shenyu/springboot/starter/netty/ShenyuNettyWebServerConfiguration.java:
##########
@@ -78,33 +78,17 @@ private static class EventLoopNettyCustomizer implements
NettyServerCustomizer {
@Override
public HttpServer apply(final HttpServer httpServer) {
- return httpServer
- .tcpConfiguration(tcpServer -> tcpServer
- .runOn(LoopResources.create("shenyu-netty",
nettyTcpProperties.getSelectCount(), nettyTcpProperties.getWorkerCount(), true))
- .selectorOption(ChannelOption.SO_BACKLOG,
nettyTcpProperties.getServerSocketChannel().getSoBacklog())
- .selectorOption(ChannelOption.SO_REUSEADDR,
nettyTcpProperties.getServerSocketChannel().isSoReuseAddr())
- .selectorOption(ChannelOption.SO_RCVBUF,
nettyTcpProperties.getServerSocketChannel().getSoRcvBuf())
-
.selectorOption(ChannelOption.CONNECT_TIMEOUT_MILLIS,
nettyTcpProperties.getServerSocketChannel().getConnectTimeoutMillis())
-
.selectorOption(ChannelOption.WRITE_BUFFER_WATER_MARK, new
WriteBufferWaterMark(nettyTcpProperties.getServerSocketChannel().getWriteBufferLowWaterMark(),
-
nettyTcpProperties.getServerSocketChannel().getWriteBufferHighWaterMark()))
- .selectorOption(ChannelOption.WRITE_SPIN_COUNT,
nettyTcpProperties.getServerSocketChannel().getWriteSpinCount())
- .selectorOption(ChannelOption.AUTO_READ,
nettyTcpProperties.getServerSocketChannel().isAutoRead())
- .selectorOption(ChannelOption.ALLOCATOR,
nettyTcpProperties.getServerSocketChannel().getAllocator())
-
- .option(ChannelOption.SO_KEEPALIVE,
nettyTcpProperties.getSocketChannel().isSoKeepAlive())
- .option(ChannelOption.SO_REUSEADDR,
nettyTcpProperties.getSocketChannel().isSoReuseAddr())
- .option(ChannelOption.SO_LINGER,
nettyTcpProperties.getSocketChannel().getSoLinger())
- .option(ChannelOption.TCP_NODELAY,
nettyTcpProperties.getSocketChannel().isTcpNoDelay())
Review Comment:
why remove this ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]