This is an automated email from the ASF dual-hosted git repository. dsoumis pushed a commit to branch 11.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 541192875d3c33eed5d051091ced896ef73b162a Author: Dimitris Soumis <[email protected]> AuthorDate: Sun Mar 29 15:22:25 2026 +0300 Add support for NIO2 connector in TestLargeClientHello --- java/org/apache/tomcat/util/net/SecureNio2Channel.java | 3 +++ test/org/apache/tomcat/util/net/TestLargeClientHello.java | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/java/org/apache/tomcat/util/net/SecureNio2Channel.java b/java/org/apache/tomcat/util/net/SecureNio2Channel.java index 0a75377b9c..a04a4e1774 100644 --- a/java/org/apache/tomcat/util/net/SecureNio2Channel.java +++ b/java/org/apache/tomcat/util/net/SecureNio2Channel.java @@ -590,6 +590,9 @@ public class SecureNio2Channel extends Nio2Channel { // call unwrap getBufHandler().configureReadBufferForWrite(); result = sslEngine.unwrap(netInBuffer, getBufHandler().getReadBuffer()); + if (log.isDebugEnabled() && result.getStatus() == SSLEngineResult.Status.BUFFER_UNDERFLOW) { + log.debug(sm.getString("channel.nio.ssl.handshakeUnwrapBufferUnderflow")); + } /* * ByteBuffer.compact() is an optional method but netInBuffer is created from either ByteBuffer.allocate() * or ByteBuffer.allocateDirect() and the ByteBuffers returned by those methods do implement compact(). The diff --git a/test/org/apache/tomcat/util/net/TestLargeClientHello.java b/test/org/apache/tomcat/util/net/TestLargeClientHello.java index 43370f9c54..61e8de5eb2 100644 --- a/test/org/apache/tomcat/util/net/TestLargeClientHello.java +++ b/test/org/apache/tomcat/util/net/TestLargeClientHello.java @@ -65,7 +65,10 @@ public class TestLargeClientHello extends TomcatBaseTest { TesterSupport.initSsl(tomcat, keystoreFile.getAbsolutePath(), false); - try (LogCapture logCapture = attachLogCapture(Level.FINE, "org.apache.tomcat.util.net.SecureNioChannel")) { + try (LogCapture nioCapture = attachLogCapture(Level.FINE, + "org.apache.tomcat.util.net.SecureNioChannel"); + LogCapture nio2Capture = attachLogCapture(Level.FINE, + "org.apache.tomcat.util.net.SecureNio2Channel")) { tomcat.start(); @@ -77,8 +80,10 @@ public class TestLargeClientHello extends TomcatBaseTest { Assert.assertTrue(getUrl(url).toString().contains("Hello World")); Assert.assertTrue(getUrl(url).toString().contains("Hello World")); - Assert.assertTrue(logCapture.containsText( + Assert.assertTrue(nioCapture.containsText( TomcatBaseTest.getKeyFromPropertiesFile("org.apache.tomcat.util.net", + "channel.nio.ssl.handshakeUnwrapBufferUnderflow")) || nio2Capture.containsText( + TomcatBaseTest.getKeyFromPropertiesFile("org.apache.tomcat.util.net", "channel.nio.ssl.handshakeUnwrapBufferUnderflow"))); } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
