GeezerVison is showing github.com — Port 5.0: Bound the SNI host name by the server_name extension (#18121) by chrisvest · Pull Request #18449 · netty/netty
Conversation
Motivation:
AbstractSniHandler.extractSniHostname(...) bounds the host_name length by extensionsLimit, the end of all extensions, not by the end of the server_name extension. RFC 6066 requires the ServerNameList to fill the extension data. As a result a host_name could be read from the header and data of the following extension(s), the server_name_list length was never checked, and an empty host_name was returned as "".
Modification:
- Bound the SNI parse by the end of the
server_name extension.
- Require the
server_name_list length to match the extension data.
- Reject an empty
host_name.
- Throw NotSslRecordException for a malformed
server_name extension and fail closed in SslClientHelloHandler instead of selecting the default.
- Add tests to
AbstractSniHandlerTest and SslClientHelloHandlerTest.
Result:
Only host names contained in the server_name extension are returned; malformed server_name extensions cause the handshake to fail closed.
(cherry picked from commit 20dd973)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Motivation:
`AbstractSniHandler.extractSniHostname(...)` bounds the `host_name`
length by `extensionsLimit`, the end of all extensions, not by the end
of the `server_name` extension. RFC 6066 requires the `ServerNameList`
to fill the extension data. As a result a `host_name` could be read from
the header and data of the following extension(s), the
`server_name_list` length was never checked, and an empty `host_name`
was returned as `""`.
Modification:
- Bound the SNI parse by the end of the `server_name` extension.
- Require the `server_name_list` length to match the extension data.
- Reject an empty `host_name`.
- Throw NotSslRecordException for a malformed `server_name` extension
and fail closed in SslClientHelloHandler instead of selecting the
default.
- Add tests to `AbstractSniHandlerTest` and `SslClientHelloHandlerTest`.
Result:
Only host names contained in the `server_name` extension are returned;
malformed `server_name` extensions cause the handshake to fail closed.
(cherry picked from commit 20dd973)
Co-authored-by: Norman Maurer <[email protected]>
testlens-app
Bot
commented
Nov 18, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
🚨 TestLens detected 1 failed test 🚨
Test Summary
Tip Inspect all details with the TestLens CLI: testlens pr 18449
| Test |
Runs |
| KQueueJdkLoopbackSocketSslEchoTest > testSslEcho(SslContext, SslContext, Renegotiation, boolean, boolean, boolean, boolean, boolean, TestInfo) > 113: serverEngine = io.netty.handler.ssl.JdkSslServerContext@5dd12c19, clientEngine = io.netty.handler.ssl.OpenSslClientContext@27b7913, renegotiation = NONE, serverUsesDelegatedTaskExecutor = true, clientUsesDelegatedTaskExecutor = false, autoRead = false, useChunkedWriteHandler = false, useCompositeByteBuf = false |
❌ |
🏷️ Commit: 80f5ece
▶️ Tests: 7404 executed
🟡 Checks: 21/23 completed
Test Failures
KQueueJdkLoopbackSocketSslEchoTest > testSslEcho(SslContext, SslContext, Renegotiation, boolean, boolean, boolean, boolean, boolean, TestInfo) > 113: serverEngine = io.netty.handler.ssl.JdkSslServerContext@5dd12c19, clientEngine = io.netty.handler.ssl.OpenSslClientContext@27b7913, renegotiation = NONE, serverUsesDelegatedTaskExecutor = true, clientUsesDelegatedTaskExecutor = false, autoRead = false, useChunkedWriteHandler = false, useCompositeByteBuf = false (Netty/Transport/Native/KQueue in Build PR / macos-x86_64-java25-boringssl build | Attempt 1/2)
java.util.concurrent.TimeoutException: testSslEcho(io.netty.handler.ssl.SslContext, io.netty.handler.ssl.SslContext, io.netty.testsuite.transport.socket.SocketSslEchoTest$Renegotiation, boolean, boolean, boolean, boolean, boolean, org.junit.jupiter.api.TestInfo) timed out after 30000 milliseconds
at java.base/java.util.Optional.ifPresent(Optional.java:178)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:214)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:186)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:214)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1716)
at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:803)
at java.base/java.util.stream.ReferencePipeline$7$1FlatMap.accept(ReferencePipeline.java:293)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:214)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:214)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:214)
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1024)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
at java.base/java.util.stream.ReferencePipeline$7$1FlatMap.accept(ReferencePipeline.java:293)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1716)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
at java.base/java.util.stream.ReferencePipeline$7$1FlatMap.accept(ReferencePipeline.java:293)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:214)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:214)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:214)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1716)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:153)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:176)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:632)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
Suppressed: java.lang.InterruptedException
at java.base/java.lang.Object.wait0(Native Method)
at java.base/java.lang.Object.wait(Object.java:389)
at java.base/java.lang.Object.wait(Object.java:351)
at io.netty.util.concurrent.DefaultPromise.await(DefaultPromise.java:243)
at io.netty.util.concurrent.DefaultPromise.sync(DefaultPromise.java:395)
at io.netty.util.concurrent.DefaultPromise.sync(DefaultPromise.java:36)
at io.netty.testsuite.transport.socket.SocketSslEchoTest.testSslEcho(SocketSslEchoTest.java:324)
at io.netty.testsuite.transport.socket.SocketSslEchoTest$1.run(SocketSslEchoTest.java:254)
at io.netty.testsuite.transport.socket.SocketSslEchoTest$1.run(SocketSslEchoTest.java:251)
at io.netty.testsuite.transport.AbstractComboTestsuiteTest.run(AbstractComboTestsuiteTest.java:52)
at io.netty.testsuite.transport.socket.SocketSslEchoTest.testSslEcho(SocketSslEchoTest.java:251)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
... 40 more
Rerun Controls
Note Checks are currently running using the configuration below.
Select tests to mute in this pull request:
🔲 KQueueJdkLoopbackSocketSslEchoTest > testSslEcho(SslContext, SslContext, Renegotiation, boolean, boolean, boolean, boolean, boolean, TestInfo)
Reuse successful test results:
🔲 ♻️ Only rerun the tests that failed or were muted before
Click the checkbox to trigger a rerun:
☑️ Rerun jobs
Learn more about TestLens at testlens.app/docs.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|