GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Auto-port 4.1: Call `handshakeFailure` for failed TLS completion events by netty-project-bot · Pull Request #18327 · netty/netty

Auto-port 4.1: Call handshakeFailure for failed TLS completion events #18327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
normanmaurer merged 3 commits into 4.1 from auto-port-pr-18323-to-4.1
Nov 11, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

Auto-port 4.1: Call handshakeFailure for failed TLS completion events #18327

Changes from 1 commit
Commits
Show all changes
3 commits
Select commit Hold shift + click to select a range
a535126
Call `handshakeFailure` for failed TLS completion events (#18323)
gavinbunney Nov 10, 2026
b7fdebb
Fix Java 6 compile issues in ApplicationProtocolNegotiationHandlerTest
normanmaurer Nov 11, 2026
e2c8f67
Avoid Arguments.of in ApplicationProtocolNegotiationHandlerTest
normanmaurer Nov 11, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
Fix Java 6 compile issues in ApplicationProtocolNegotiationHandlerTest
Motivation:

The auto-port of #18323 to 4.1 failed to compile because the 4.1 branch
has a Java 6 source baseline.

Modification:

Replace the lambda with an anonymous AsyncMapping, mark captured locals
and parameters as final, and return a List instead of a Stream from the
MethodSource provider.

Result:

The test compiles with -source 1.6.
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
normanmaurer committed Nov 11, 2026
commit b7fdebb943a32539743aea705123d8d9e190126f

There are no files selected for viewing

57 changes: 33 additions & 24 deletions 57 handler/src/test/java/io/netty/handler/ssl/ApplicationProtocolNegotiationHandlerTest.java
Show comments Show annotations
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.channel.socket.ChannelInputShutdownEvent;
import io.netty.handler.codec.DecoderException;
import io.netty.util.AsyncMapping;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.Promise;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.function.Executable;
import org.junit.jupiter.params.ParameterizedTest;
Expand All @@ -35,10 +38,11 @@
import javax.net.ssl.SSLHandshakeException;
import java.nio.channels.ClosedChannelException;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Stream;

import static io.netty.handler.ssl.CloseNotifyTest.assertCloseNotify;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
Expand Down Expand Up @@ -82,11 +86,11 @@

@ParameterizedTest
@ValueSource(booleans = {false, true})
public void testHandshakeFailure(boolean exceptionDuringEvent) {
AtomicInteger failureCount = new AtomicInteger();
AtomicInteger failureCountOnExceptionReturn = new AtomicInteger();
AtomicInteger downstreamExceptionCount = new AtomicInteger();
AtomicReference<Throwable> failureCause = new AtomicReference<Throwable>();
public void testHandshakeFailure(final boolean exceptionDuringEvent) {
final AtomicInteger failureCount = new AtomicInteger();
final AtomicInteger failureCountOnExceptionReturn = new AtomicInteger();
final AtomicInteger downstreamExceptionCount = new AtomicInteger();
final AtomicReference<Throwable> failureCause = new AtomicReference<Throwable>();
ChannelHandler alpnHandler = new ApplicationProtocolNegotiationHandler(ApplicationProtocolNames.HTTP_1_1) {
@Override
protected void configurePipeline(ChannelHandlerContext ctx, String protocol) {
Expand All @@ -106,8 +110,8 @@
}
};

SSLHandshakeException exception = new SSLHandshakeException("error");
SslHandshakeCompletionEvent completionEvent = new SslHandshakeCompletionEvent(exception);
final SSLHandshakeException exception = new SSLHandshakeException("error");
final SslHandshakeCompletionEvent completionEvent = new SslHandshakeCompletionEvent(exception);
EmbeddedChannel channel = new EmbeddedChannel(alpnHandler, new ChannelInboundHandlerAdapter() {
@Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) {
Expand Down Expand Up @@ -140,10 +144,10 @@

@ParameterizedTest
@MethodSource("handshakeFailureCauses")
public void testHandshakeFailureEvent(Throwable cause) {
AtomicReference<SslHandshakeCompletionEvent> eventRef =
public void testHandshakeFailureEvent(final Throwable cause) {
final AtomicReference<SslHandshakeCompletionEvent> eventRef =
new AtomicReference<SslHandshakeCompletionEvent>();
AtomicReference<Throwable> failureCause = new AtomicReference<Throwable>();
final AtomicReference<Throwable> failureCause = new AtomicReference<Throwable>();
ChannelHandler alpnHandler = new ApplicationProtocolNegotiationHandler(ApplicationProtocolNames.HTTP_1_1) {
@Override
protected void configurePipeline(ChannelHandlerContext ctx, String protocol) {
Expand All @@ -164,7 +168,7 @@
}
}
});
SslHandshakeCompletionEvent completionEvent = new SslHandshakeCompletionEvent(cause);
final SslHandshakeCompletionEvent completionEvent = new SslHandshakeCompletionEvent(cause);

channel.pipeline().fireUserEventTriggered(completionEvent);

Expand All @@ -174,16 +178,16 @@
assertFalse(channel.finishAndReleaseAll());
}

private static Stream<Arguments> handshakeFailureCauses() {
return Stream.of(
private static List<Arguments> handshakeFailureCauses() {
return Arrays.asList(
Arguments.of(new SslHandshakeTimeoutException("timed out")),

Check failure on line 183 in handler/src/test/java/io/netty/handler/ssl/ApplicationProtocolNegotiationHandlerTest.java

View workflow job for this annotation

GitHub Actions / Analyze (cpp)

error: static interface method invocations are not supported in -source 6

Check failure on line 183 in handler/src/test/java/io/netty/handler/ssl/ApplicationProtocolNegotiationHandlerTest.java

View workflow job for this annotation

GitHub Actions / Analyze (cpp)

error: static interface method invocations are not supported in -source 6

Check failure on line 183 in handler/src/test/java/io/netty/handler/ssl/ApplicationProtocolNegotiationHandlerTest.java

View workflow job for this annotation

GitHub Actions / verify-pr

error: static interface method invocations are not supported in -source 1.6

Check failure on line 183 in handler/src/test/java/io/netty/handler/ssl/ApplicationProtocolNegotiationHandlerTest.java

View workflow job for this annotation

GitHub Actions / verify-pr

error: static interface method invocations are not supported in -source 1.6

Check failure on line 183 in handler/src/test/java/io/netty/handler/ssl/ApplicationProtocolNegotiationHandlerTest.java

View workflow job for this annotation

GitHub Actions / Analyze (java)

error: static interface method invocations are not supported in -source 6

Check failure on line 183 in handler/src/test/java/io/netty/handler/ssl/ApplicationProtocolNegotiationHandlerTest.java

View workflow job for this annotation

GitHub Actions / Analyze (java)

error: static interface method invocations are not supported in -source 6
Arguments.of(new ClosedChannelException()));

Check failure on line 184 in handler/src/test/java/io/netty/handler/ssl/ApplicationProtocolNegotiationHandlerTest.java

View workflow job for this annotation

GitHub Actions / verify-pr

error: static interface method invocations are not supported in -source 1.6

Check failure on line 184 in handler/src/test/java/io/netty/handler/ssl/ApplicationProtocolNegotiationHandlerTest.java

View workflow job for this annotation

GitHub Actions / verify-pr

error: static interface method invocations are not supported in -source 1.6
}

@Test
public void testHandshakeFailureExceptionWithoutEvent() {
AtomicInteger failureCount = new AtomicInteger();
AtomicReference<Throwable> failureCause = new AtomicReference<Throwable>();
final AtomicInteger failureCount = new AtomicInteger();
final AtomicReference<Throwable> failureCause = new AtomicReference<Throwable>();
ChannelHandler alpnHandler = new ApplicationProtocolNegotiationHandler(ApplicationProtocolNames.HTTP_1_1) {
@Override
protected void configurePipeline(ChannelHandlerContext ctx, String protocol) {
Expand All @@ -197,7 +201,7 @@
}
};
EmbeddedChannel channel = new EmbeddedChannel(alpnHandler);
SSLHandshakeException exception = new SSLHandshakeException("error");
final SSLHandshakeException exception = new SSLHandshakeException("error");

channel.pipeline().fireExceptionCaught(new DecoderException(exception));

Expand All @@ -209,12 +213,12 @@

@Test
public void testSniLookupFailure() {
SSLHandshakeException exception = new SSLHandshakeException("SNI lookup failed");
AtomicInteger failureCount = new AtomicInteger();
AtomicInteger handshakeEventCount = new AtomicInteger();
AtomicInteger downstreamExceptionCount = new AtomicInteger();
AtomicReference<Throwable> failureCause = new AtomicReference<Throwable>();
AtomicReference<SniCompletionEvent> sniEvent = new AtomicReference<SniCompletionEvent>();
final SSLHandshakeException exception = new SSLHandshakeException("SNI lookup failed");
final AtomicInteger failureCount = new AtomicInteger();
final AtomicInteger handshakeEventCount = new AtomicInteger();
final AtomicInteger downstreamExceptionCount = new AtomicInteger();
final AtomicReference<Throwable> failureCause = new AtomicReference<Throwable>();
final AtomicReference<SniCompletionEvent> sniEvent = new AtomicReference<SniCompletionEvent>();
ChannelHandler alpnHandler = new ApplicationProtocolNegotiationHandler(ApplicationProtocolNames.HTTP_1_1) {
@Override
protected void configurePipeline(ChannelHandlerContext ctx, String protocol) {
Expand All @@ -227,7 +231,12 @@
failureCause.set(cause);
}
};
SniHandler sniHandler = new SniHandler((hostname, promise) -> promise.setFailure(exception));
final SniHandler sniHandler = new SniHandler(new AsyncMapping<String, SslContext>() {
@Override
public Future<SslContext> map(String input, Promise<SslContext> promise) {
return promise.setFailure(exception);
}
});
EmbeddedChannel channel = new EmbeddedChannel(sniHandler, alpnHandler, new ChannelInboundHandlerAdapter() {
@Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) {
Expand Down
Loading
Oops, something went wrong.

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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.