You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2019/09/24 16:07:16 UTC

[tomcat] branch master updated: BZ63765: Try to unwrap first after handshake

This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
     new 1cbb2ed  BZ63765: Try to unwrap first after handshake
1cbb2ed is described below

commit 1cbb2ed755118650b60a7e0292f9384dde8340f5
Author: remm <re...@apache.org>
AuthorDate: Tue Sep 24 18:07:03 2019 +0200

    BZ63765: Try to unwrap first after handshake
    
    This seems to only be an issue right after the handshake.
---
 java/org/apache/tomcat/util/net/SecureNio2Channel.java | 3 ++-
 webapps/docs/changelog.xml                             | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/net/SecureNio2Channel.java b/java/org/apache/tomcat/util/net/SecureNio2Channel.java
index 9e5ab07..740f12b 100644
--- a/java/org/apache/tomcat/util/net/SecureNio2Channel.java
+++ b/java/org/apache/tomcat/util/net/SecureNio2Channel.java
@@ -70,7 +70,7 @@ public class SecureNio2Channel extends Nio2Channel  {
     protected boolean closed;
     protected boolean closing;
 
-    private volatile boolean unwrapBeforeRead = false;
+    private volatile boolean unwrapBeforeRead;
     private final CompletionHandler<Integer, SocketWrapperBase<Nio2Channel>> handshakeReadCompletionHandler;
     private final CompletionHandler<Integer, SocketWrapperBase<Nio2Channel>> handshakeWriteCompletionHandler;
 
@@ -130,6 +130,7 @@ public class SecureNio2Channel extends Nio2Channel  {
         sslEngine = null;
         sniComplete = false;
         handshakeComplete = false;
+        unwrapBeforeRead = true;
         closed = false;
         closing = false;
         netInBuffer.clear();
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 2b160da..aea333c 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -52,6 +52,10 @@
         generating or parsing the <code>HTTP2-Settings</code> header as part of
         an HTTP upgrade to <code>h2c</code> as required by RFC 7540. (markt)
       </fix>
+      <fix>
+        <bug>63765</bug>: NIO2 should try to unwrap after TLS handshake to
+        avoid edge cases. (remm)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Web Socket">


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org