follow-up: kestrel tls listener callback#62266
Merged
BrennanConroy merged 5 commits intodotnet:mainfrom Jun 7, 2025
DeagleGross:dmkorolev/kestrel-tls-followup
Merged
follow-up: kestrel tls listener callback#62266BrennanConroy merged 5 commits intodotnet:mainfrom DeagleGross:dmkorolev/kestrel-tls-followup
BrennanConroy merged 5 commits intodotnet:mainfrom
DeagleGross:dmkorolev/kestrel-tls-followup
Conversation
| cts.Cancel(); | ||
|
|
||
| await Assert.ThrowsAsync<OperationCanceledException>(async () => await listenerTask); | ||
| await VerifyThrowsAnyAsync(() => listenerTask, typeof(OperationCanceledException), typeof(TaskCanceledException)); |
Member
There was a problem hiding this comment.
Normally we just use Assert.ThrowsAnyAsync<OperationCanceledException>(...); for this
Member
Author
There was a problem hiding this comment.
thanks, i did not see that API before. refactored
| } | ||
|
|
||
| [Fact] | ||
| public async Task TlsClientHelloBytesCallback_PreCanceledToken() |
| { | ||
| using (var connection = server.CreateConnection()) | ||
| { | ||
| using (var sslStream = new SslStream(connection.Stream, false, (sender, cert, chain, errors) => true, null)) |
Member
There was a problem hiding this comment.
I don't think these tests should actually send any bytes over the connection. That creates a race where the timeout doesn't actually occur by the time the tls client hello is received and parsed.
Member
Author
There was a problem hiding this comment.
HttpsConnectionMiddleware does catch the exception, so i am only seeing if the connection is closed after the timeout. I changed to
await connection.TransportConnection.Input.WriteAsync(new byte[] { 0x16 });
var readResult = await connection.TransportConnection.Output.ReadAsync();
// HttpsConnectionMiddleware catches the exception, so we can only check the effects of the timeout here
Assert.True(readResult.IsCompleted);
BrennanConroy
approved these changes
Jun 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds a test discussed here and fixes the check limits in other test which is failing in helix.
Fixes #62172