diff --git a/src/Servers/Kestrel/Transport.Quic/test/QuicConnectionListenerTests.cs b/src/Servers/Kestrel/Transport.Quic/test/QuicConnectionListenerTests.cs index 71603ee35911..7e0a40ebb588 100644 --- a/src/Servers/Kestrel/Transport.Quic/test/QuicConnectionListenerTests.cs +++ b/src/Servers/Kestrel/Transport.Quic/test/QuicConnectionListenerTests.cs @@ -101,18 +101,15 @@ static void AssertTlsConnectionFeature(IFeatureCollection features, X509Certific [ConditionalFact] [MsQuicSupported] - // https://github.com/dotnet/runtime/issues/57308, RemoteCertificateValidationCallback should allow us to accept a null cert, - // but it doesn't right now. [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] - [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/41894")] - public async Task ClientCertificate_Required_NotSent_ConnectionAborted() + public async Task ClientCertificate_Required_NotSent_AcceptedViaCallback() { await using var connectionListener = await QuicTestHelpers.CreateConnectionListenerFactory(LoggerFactory, clientCertificateRequired: true); var options = QuicTestHelpers.CreateClientConnectionOptions(connectionListener.EndPoint); using var clientConnection = new QuicConnection(options); - var qex = await Assert.ThrowsAnyAsync(async () => await clientConnection.ConnectAsync().DefaultTimeout()); - Assert.StartsWith("Connection has been shutdown by transport:", qex.Message); + await clientConnection.ConnectAsync().DefaultTimeout(); + Assert.True(clientConnection.Connected); } } diff --git a/src/Servers/Kestrel/test/Interop.FunctionalTests/Http3/Http3RequestTests.cs b/src/Servers/Kestrel/test/Interop.FunctionalTests/Http3/Http3RequestTests.cs index b4b6a03f77ea..09bb48d76628 100644 --- a/src/Servers/Kestrel/test/Interop.FunctionalTests/Http3/Http3RequestTests.cs +++ b/src/Servers/Kestrel/test/Interop.FunctionalTests/Http3/Http3RequestTests.cs @@ -393,7 +393,6 @@ public async Task POST_ClientCancellationUpload_RequestAbortRaised(HttpProtocols [MsQuicSupported] [InlineData(HttpProtocols.Http3)] [InlineData(HttpProtocols.Http2)] - [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/35070")] public async Task POST_ServerAbort_ClientReceivesAbort(HttpProtocols protocol) { // Arrange diff --git a/src/Servers/Kestrel/test/Interop.FunctionalTests/Http3/Http3TlsTests.cs b/src/Servers/Kestrel/test/Interop.FunctionalTests/Http3/Http3TlsTests.cs index e06b9382820a..67430dc5b054 100644 --- a/src/Servers/Kestrel/test/Interop.FunctionalTests/Http3/Http3TlsTests.cs +++ b/src/Servers/Kestrel/test/Interop.FunctionalTests/Http3/Http3TlsTests.cs @@ -196,17 +196,16 @@ public async Task ClientCertificate_AllowOrRequire_Available_Invalid_Refused(Cli if (!serverAllowInvalid) { - // In .NET 6 there is a race condition between throwing HttpRequestException and QuicException. - // Unable to test the exact error. - var ex = await Assert.ThrowsAnyAsync(() => sendTask).DefaultTimeout(); + var ex = await Assert.ThrowsAnyAsync(() => sendTask).DefaultTimeout(); Logger.LogInformation(ex, "SendAsync successfully threw error."); } else { - // Because we can't verify the exact error reason, check that the cert is the cause be successfully + // Because we can't verify the exact error reason, check that the cert is the cause by successfully // making a call when invalid certs are allowed. - var response = await sendTask.DefaultTimeout(); + using var response = await sendTask.DefaultTimeout(); response.EnsureSuccessStatusCode(); + Assert.Equal("True", await response.Content.ReadAsStringAsync().DefaultTimeout()); } await host.StopAsync().DefaultTimeout(); @@ -215,7 +214,6 @@ public async Task ClientCertificate_AllowOrRequire_Available_Invalid_Refused(Cli [ConditionalFact] [MsQuicSupported] [OSSkipCondition(OperatingSystems.MacOSX | OperatingSystems.Linux, SkipReason = "https://github.com/dotnet/aspnetcore/issues/35800")] - [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/41894")] public async Task ClientCertificate_Allow_NotAvailable_Optional() { var builder = CreateHostBuilder(async context => @@ -245,9 +243,9 @@ public async Task ClientCertificate_Allow_NotAvailable_Optional() request.Version = HttpVersion.Version30; request.VersionPolicy = HttpVersionPolicy.RequestVersionExact; - // https://github.com/dotnet/runtime/issues/57308, optional client certs aren't supported. - var ex = await Assert.ThrowsAsync(() => client.SendAsync(request, CancellationToken.None).DefaultTimeout()); - Assert.StartsWith("Connection has been shutdown by transport:", ex.Message); + var response = await client.SendAsync(request, CancellationToken.None).DefaultTimeout(); + Assert.True(response.IsSuccessStatusCode); + Assert.Equal("False", await response.Content.ReadAsStringAsync()); await host.StopAsync().DefaultTimeout(); }