From 622058a2862b780d8083957ea575d6201d330b30 Mon Sep 17 00:00:00 2001
From: Simona Tankova <82508193+simonatan@users.noreply.github.com>
Date: Mon, 23 Oct 2023 11:08:42 +0300
Subject: [PATCH] Update TLS configuration defaults in javadoc (#2939)
- 3s for close_notify flush timeout
- 0s for close_notify read timeout
---
.../java/reactor/netty/tcp/TcpClient.java | 22 +++++++++++++------
.../java/reactor/netty/tcp/TcpServer.java | 12 ++++++----
.../reactor/netty/http/client/HttpClient.java | 6 ++++-
.../reactor/netty/http/server/HttpServer.java | 21 ++++++++++++------
4 files changed, 42 insertions(+), 19 deletions(-)
diff --git a/reactor-netty-core/src/main/java/reactor/netty/tcp/TcpClient.java b/reactor-netty-core/src/main/java/reactor/netty/tcp/TcpClient.java
index 70a1b01c0e..deeec9c4c0 100644
--- a/reactor-netty-core/src/main/java/reactor/netty/tcp/TcpClient.java
+++ b/reactor-netty-core/src/main/java/reactor/netty/tcp/TcpClient.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2021 VMware, Inc. or its affiliates, All Rights Reserved.
+ * Copyright (c) 2011-2023 VMware, Inc. or its affiliates, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -312,9 +312,13 @@ public TcpClient runOn(LoopResources loopResources, boolean preferNative) {
/**
* Enable default sslContext support. The default {@link SslContext} will be
- * assigned to
- * with a default value of {@code 10} seconds handshake timeout unless
- * the environment property {@code reactor.netty.tcp.sslHandshakeTimeout} is set.
+ * assigned to with a default value of:
+ *
+ * - {@code 10} seconds handshake timeout unless the environment property
+ * {@code reactor.netty.tcp.sslHandshakeTimeout} is set.
+ * - {@code 3} seconds close_notify flush timeout
+ * - {@code 0} second close_notify read timeout
+ *
*
* @return a new {@link TcpClient}
*/
@@ -326,9 +330,13 @@ public TcpClient secure() {
/**
* Apply an SSL configuration customization via the passed builder. The builder
- * will produce the {@link SslContext} to be passed to with a default value of
- * {@code 10} seconds handshake timeout unless the environment property {@code
- * reactor.netty.tcp.sslHandshakeTimeout} is set.
+ * will produce the {@link SslContext} to be passed to with a default value of:
+ *
+ * - {@code 10} seconds handshake timeout unless the environment property
+ * {@code reactor.netty.tcp.sslHandshakeTimeout} is set.
+ * - {@code 3} seconds close_notify flush timeout
+ * - {@code 0} second close_notify read timeout
+ *
*
* @param sslProviderBuilder builder callback for further customization of SslContext.
*
diff --git a/reactor-netty-core/src/main/java/reactor/netty/tcp/TcpServer.java b/reactor-netty-core/src/main/java/reactor/netty/tcp/TcpServer.java
index c6b162092b..705aa4164c 100644
--- a/reactor-netty-core/src/main/java/reactor/netty/tcp/TcpServer.java
+++ b/reactor-netty-core/src/main/java/reactor/netty/tcp/TcpServer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2021 VMware, Inc. or its affiliates, All Rights Reserved.
+ * Copyright (c) 2011-2023 VMware, Inc. or its affiliates, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -168,9 +168,13 @@ public TcpServer runOn(LoopResources loopResources, boolean preferNative) {
/**
* Apply an SSL configuration customization via the passed builder. The builder
- * will produce the {@link SslContext} to be passed to with a default value of
- * {@code 10} seconds handshake timeout unless the environment property {@code
- * reactor.netty.tcp.sslHandshakeTimeout} is set.
+ * will produce the {@link SslContext} to be passed to with a default value of:
+ *
+ * - {@code 10} seconds handshake timeout unless the environment property
+ * {@code reactor.netty.tcp.sslHandshakeTimeout} is set.
+ * - {@code 3} seconds close_notify flush timeout
+ * - {@code 0} second close_notify read timeout
+ *
*
* If {@link SelfSignedCertificate} needs to be used, the sample below can be
* used. Note that {@link SelfSignedCertificate} should not be used in production.
diff --git a/reactor-netty-http/src/main/java/reactor/netty/http/client/HttpClient.java b/reactor-netty-http/src/main/java/reactor/netty/http/client/HttpClient.java
index 52f0d67ca9..b352bb4880 100644
--- a/reactor-netty-http/src/main/java/reactor/netty/http/client/HttpClient.java
+++ b/reactor-netty-http/src/main/java/reactor/netty/http/client/HttpClient.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2022 VMware, Inc. or its affiliates, All Rights Reserved.
+ * Copyright (c) 2011-2023 VMware, Inc. or its affiliates, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1383,6 +1383,8 @@ public final HttpClient responseTimeout(@Nullable Duration maxReadOperationInter
*
* - {@code 10} seconds handshake timeout unless
* the environment property {@code reactor.netty.tcp.sslHandshakeTimeout} is set
+ * - {@code 3} seconds close_notify flush timeout
+ * - {@code 0} second close_notify read timeout
* - hostname verification enabled
*
*
@@ -1405,6 +1407,8 @@ public final HttpClient secure() {
*
* - {@code 10} seconds handshake timeout unless the passed builder sets another configuration or
* the environment property {@code reactor.netty.tcp.sslHandshakeTimeout} is set
+ * - {@code 3} seconds close_notify flush timeout
+ * - {@code 0} second close_notify read timeout
* - hostname verification enabled
*
*
diff --git a/reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServer.java b/reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServer.java
index a6fd2a2328..1da45af4aa 100644
--- a/reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServer.java
+++ b/reactor-netty-http/src/main/java/reactor/netty/http/server/HttpServer.java
@@ -800,10 +800,13 @@ public final HttpServer route(Consumer super HttpServerRoutes> routesBuilder)
/**
* Apply an SSL configuration customization via the passed builder. The builder
- * will produce the {@link SslContext} to be passed to with a default value of
- * {@code 10} seconds handshake timeout unless the environment property {@code
- * reactor.netty.tcp.sslHandshakeTimeout} is set.
- *
+ * will produce the {@link SslContext} to be passed to with a default value of:
+ *
+ * - {@code 10} seconds handshake timeout unless the environment property
+ * {@code reactor.netty.tcp.sslHandshakeTimeout} is set.
+ * - {@code 3} seconds close_notify flush timeout
+ * - {@code 0} second close_notify read timeout
+ *
* If {@link SelfSignedCertificate} needs to be used, the sample below can be
* used. Note that {@link SelfSignedCertificate} should not be used in production.
*
@@ -824,9 +827,13 @@ public final HttpServer secure(Consumer super SslProvider.SslContextSpec> sslP
/**
* Apply an SSL configuration customization via the passed builder. The builder
- * will produce the {@link SslContext} to be passed to with a default value of
- * {@code 10} seconds handshake timeout unless the environment property {@code
- * reactor.netty.tcp.sslHandshakeTimeout} is set.
+ * will produce the {@link SslContext} to be passed to with a default value of:
+ *
+ * - {@code 10} seconds handshake timeout unless the environment property
+ * {@code reactor.netty.tcp.sslHandshakeTimeout} is set.
+ * - {@code 3} seconds close_notify flush timeout
+ * - {@code 0} second close_notify read timeout
+ *
*
* If {@link SelfSignedCertificate} needs to be used, the sample below can be
* used. Note that {@link SelfSignedCertificate} should not be used in production.