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