This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push:
new 993e80e BZ63765: Try to unwrap first after handshake
993e80e is described below
commit 993e80e0be6fc93fae7e253621eec4a29ac6893f
Author: remm <[email protected]>
AuthorDate: Tue Sep 24 18:22:48 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 11f31a0..9f71e0a 100644
--- a/java/org/apache/tomcat/util/net/SecureNio2Channel.java
+++ b/java/org/apache/tomcat/util/net/SecureNio2Channel.java
@@ -66,7 +66,7 @@ public class SecureNio2Channel extends Nio2Channel {
private volatile boolean handshakeComplete;
private volatile HandshakeStatus handshakeStatus; //gets set by handshake
- private volatile boolean unwrapBeforeRead = false;
+ private volatile boolean unwrapBeforeRead;
protected boolean closed;
protected boolean closing;
@@ -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 2b5f84a..58e7569 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: [email protected]
For additional commands, e-mail: [email protected]