Skip to content
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.

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

Activate Quic Alpn Narrowing Test #91116

Merged
merged 6 commits into from
Sep 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,6 @@ public async Task Listener_AlpnNarrowingDown_Success()
Assert.Equal(new SslApplicationProtocol("test"), clientConnection2.NegotiatedApplicationProtocol);
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/86701")]
[Theory]
[InlineData("foo")]
[InlineData("not_existing")]
Expand Down Expand Up @@ -503,15 +502,18 @@ public async Task Listener_AlpnNarrowingDown_Failure(string alpn)
return ValueTask.FromResult(options);
}
};
bool isAlpnPresentOnInitialAlpnList = listenerOptions.ApplicationProtocols.Contains(new SslApplicationProtocol(alpn)); // If the ALPN is not present on initial list, AcceptConnectionAsync will not throw AuthenticationException.
await using QuicListener listener = await CreateQuicListener(listenerOptions);

QuicClientConnectionOptions clientOptions = CreateQuicClientOptions(listener.LocalEndPoint);
clientOptions.ClientAuthenticationOptions.ApplicationProtocols = new()
{
new SslApplicationProtocol(alpn),
};
ValueTask<QuicConnection> connectTask = CreateQuicConnection(clientOptions);
await Assert.ThrowsAsync<AuthenticationException>(() => listener.AcceptConnectionAsync().AsTask().WaitAsync(timeoutToken));
if (isAlpnPresentOnInitialAlpnList)
{
await Assert.ThrowsAsync<AuthenticationException>(() => listener.AcceptConnectionAsync().AsTask().WaitAsync(timeoutToken));
}
await Assert.ThrowsAsync<AuthenticationException>(() => connectTask.AsTask().WaitAsync(timeoutToken));
}
}
Expand Down
Loading