Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/aspnetcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Newton-King <james@newtonking.com>2022-08-02 06:30:17 +0300
committerJames Newton-King <james@newtonking.com>2022-08-02 06:30:17 +0300
commit2b3302ec49275c5c0a0ceb7d156603e0d275aa89 (patch)
tree97df077ce5fe4ec5b27e7263b2481ea59fb3b7f8
parenta1a0056f603a1fc4bc07650dfab8489a225c1286 (diff)
-rw-r--r--src/Servers/Kestrel/Core/src/Internal/KestrelServerImpl.cs3
-rw-r--r--src/Servers/Kestrel/Transport.Quic/test/WebHostTests.cs36
2 files changed, 38 insertions, 1 deletions
diff --git a/src/Servers/Kestrel/Core/src/Internal/KestrelServerImpl.cs b/src/Servers/Kestrel/Core/src/Internal/KestrelServerImpl.cs
index d6ef8b5ffb..a95d853828 100644
--- a/src/Servers/Kestrel/Core/src/Internal/KestrelServerImpl.cs
+++ b/src/Servers/Kestrel/Core/src/Internal/KestrelServerImpl.cs
@@ -218,7 +218,8 @@ internal sealed class KestrelServerImpl : IServer
if (hasHttp3 && _multiplexedTransportFactory is not null)
{
- // The
+ // Check if a previous transport has changed the endpoint. If it has then the endpoint is dynamic and we can't guarantee it will work for other transports.
+ // For more details, see https://github.com/dotnet/aspnetcore/issues/42982
if (!configuredEndpoint.Equals(options.EndPoint))
{
Trace.LogError(CoreStrings.DynamicPortOnMultipleTransportsNotSupported);
diff --git a/src/Servers/Kestrel/Transport.Quic/test/WebHostTests.cs b/src/Servers/Kestrel/Transport.Quic/test/WebHostTests.cs
index 259cc7532d..159e516eca 100644
--- a/src/Servers/Kestrel/Transport.Quic/test/WebHostTests.cs
+++ b/src/Servers/Kestrel/Transport.Quic/test/WebHostTests.cs
@@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Connections;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Internal;
+using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.AspNetCore.Testing;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
@@ -132,6 +133,41 @@ public class WebHostTests : LoggedTest
[ConditionalFact]
[MsQuicSupported]
+ public async Task Listen_Http3AndSocketsOnDynamicEndpoint_Http3Disabled()
+ {
+ // Arrange
+ var builder = new HostBuilder()
+ .ConfigureWebHost(webHostBuilder =>
+ {
+ webHostBuilder
+ .UseKestrel(o =>
+ {
+ o.Listen(IPAddress.Parse("127.0.0.1"), 0, listenOptions =>
+ {
+ listenOptions.Protocols = Core.HttpProtocols.Http1AndHttp2AndHttp3;
+ listenOptions.UseHttps(TestResources.GetTestCertificate());
+ });
+ })
+ .Configure(app =>
+ {
+ app.Run(async context =>
+ {
+ await context.Response.WriteAsync("hello, world");
+ });
+ });
+ })
+ .ConfigureServices(AddTestLogging);
+
+ using var host = builder.Build();
+ await host.StartAsync().DefaultTimeout();
+
+ Assert.Contains(TestSink.Writes, w => w.Message == CoreStrings.DynamicPortOnMultipleTransportsNotSupported);
+
+ await host.StopAsync().DefaultTimeout();
+ }
+
+ [ConditionalFact]
+ [MsQuicSupported]
public async Task Listen_Http3AndSocketsCoexistOnSameEndpoint_ClientSuccess()
{
await BindPortsWithRetry(async port =>