File tree Expand file tree Collapse file tree
java/org/apache/tomcat/util/net
test/org/apache/tomcat/util/net Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -590,6 +590,9 @@ protected SSLEngineResult handshakeUnwrap() throws IOException {
590590 // call unwrap
591591 getBufHandler ().configureReadBufferForWrite ();
592592 result = sslEngine .unwrap (netInBuffer , getBufHandler ().getReadBuffer ());
593+ if (log .isDebugEnabled () && result .getStatus () == SSLEngineResult .Status .BUFFER_UNDERFLOW ) {
594+ log .debug (sm .getString ("channel.nio.ssl.handshakeUnwrapBufferUnderflow" ));
595+ }
593596 /*
594597 * ByteBuffer.compact() is an optional method but netInBuffer is created from either ByteBuffer.allocate()
595598 * or ByteBuffer.allocateDirect() and the ByteBuffers returned by those methods do implement compact(). The
Original file line number Diff line number Diff line change @@ -65,7 +65,10 @@ public void testLargeClientHelloWithSessionResumption() throws Exception {
6565
6666 TesterSupport .initSsl (tomcat , keystoreFile .getAbsolutePath (), false );
6767
68- try (LogCapture logCapture = attachLogCapture (Level .FINE , "org.apache.tomcat.util.net.SecureNioChannel" )) {
68+ try (LogCapture nioCapture = attachLogCapture (Level .FINE ,
69+ "org.apache.tomcat.util.net.SecureNioChannel" );
70+ LogCapture nio2Capture = attachLogCapture (Level .FINE ,
71+ "org.apache.tomcat.util.net.SecureNio2Channel" )) {
6972
7073 tomcat .start ();
7174
@@ -77,8 +80,10 @@ public void testLargeClientHelloWithSessionResumption() throws Exception {
7780 Assert .assertTrue (getUrl (url ).toString ().contains ("Hello World" ));
7881 Assert .assertTrue (getUrl (url ).toString ().contains ("Hello World" ));
7982
80- Assert .assertTrue (logCapture .containsText (
83+ Assert .assertTrue (nioCapture .containsText (
8184 TomcatBaseTest .getKeyFromPropertiesFile ("org.apache.tomcat.util.net" ,
85+ "channel.nio.ssl.handshakeUnwrapBufferUnderflow" )) || nio2Capture .containsText (
86+ TomcatBaseTest .getKeyFromPropertiesFile ("org.apache.tomcat.util.net" ,
8287 "channel.nio.ssl.handshakeUnwrapBufferUnderflow" )));
8388 }
8489
You can’t perform that action at this time.
0 commit comments