diff --git a/eng/ProjectReferences.props b/eng/ProjectReferences.props
index 494a9a560a..8d1040b157 100644
--- a/eng/ProjectReferences.props
+++ b/eng/ProjectReferences.props
@@ -63,7 +63,7 @@
-
+
diff --git a/src/Servers/Connections.Abstractions/ref/Microsoft.AspNetCore.Connections.Abstractions.netcoreapp.cs b/src/Servers/Connections.Abstractions/ref/Microsoft.AspNetCore.Connections.Abstractions.netcoreapp.cs
index 1cf1fe4d3a..b454acd516 100644
--- a/src/Servers/Connections.Abstractions/ref/Microsoft.AspNetCore.Connections.Abstractions.netcoreapp.cs
+++ b/src/Servers/Connections.Abstractions/ref/Microsoft.AspNetCore.Connections.Abstractions.netcoreapp.cs
@@ -198,7 +198,8 @@ namespace Microsoft.AspNetCore.Connections.Features
}
public partial interface IQuicStreamFeature
{
- bool IsUnidirectional { get; }
+ bool CanRead { get; }
+ bool CanWrite { get; }
long StreamId { get; }
}
public partial interface IQuicStreamListenerFeature
diff --git a/src/Servers/Connections.Abstractions/ref/Microsoft.AspNetCore.Connections.Abstractions.netstandard2.0.cs b/src/Servers/Connections.Abstractions/ref/Microsoft.AspNetCore.Connections.Abstractions.netstandard2.0.cs
index 1cf1fe4d3a..b454acd516 100644
--- a/src/Servers/Connections.Abstractions/ref/Microsoft.AspNetCore.Connections.Abstractions.netstandard2.0.cs
+++ b/src/Servers/Connections.Abstractions/ref/Microsoft.AspNetCore.Connections.Abstractions.netstandard2.0.cs
@@ -198,7 +198,8 @@ namespace Microsoft.AspNetCore.Connections.Features
}
public partial interface IQuicStreamFeature
{
- bool IsUnidirectional { get; }
+ bool CanRead { get; }
+ bool CanWrite { get; }
long StreamId { get; }
}
public partial interface IQuicStreamListenerFeature
diff --git a/src/Servers/Connections.Abstractions/ref/Microsoft.AspNetCore.Connections.Abstractions.netstandard2.1.cs b/src/Servers/Connections.Abstractions/ref/Microsoft.AspNetCore.Connections.Abstractions.netstandard2.1.cs
index 1cf1fe4d3a..b454acd516 100644
--- a/src/Servers/Connections.Abstractions/ref/Microsoft.AspNetCore.Connections.Abstractions.netstandard2.1.cs
+++ b/src/Servers/Connections.Abstractions/ref/Microsoft.AspNetCore.Connections.Abstractions.netstandard2.1.cs
@@ -198,7 +198,8 @@ namespace Microsoft.AspNetCore.Connections.Features
}
public partial interface IQuicStreamFeature
{
- bool IsUnidirectional { get; }
+ bool CanRead { get; }
+ bool CanWrite { get; }
long StreamId { get; }
}
public partial interface IQuicStreamListenerFeature
diff --git a/src/Servers/Connections.Abstractions/src/Features/IQuicStreamFeature.cs b/src/Servers/Connections.Abstractions/src/Features/IQuicStreamFeature.cs
index 98c71b7a08..802209c1ea 100644
--- a/src/Servers/Connections.Abstractions/src/Features/IQuicStreamFeature.cs
+++ b/src/Servers/Connections.Abstractions/src/Features/IQuicStreamFeature.cs
@@ -5,7 +5,8 @@ namespace Microsoft.AspNetCore.Connections.Features
{
public interface IQuicStreamFeature
{
- bool IsUnidirectional { get; }
+ bool CanRead { get; }
+ bool CanWrite { get; }
long StreamId { get; }
}
}
diff --git a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Connection.cs b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Connection.cs
index ca0ac6bc49..070931ad42 100644
--- a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Connection.cs
+++ b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Connection.cs
@@ -93,7 +93,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http3
var streamId = streamFeature.StreamId;
HighestStreamId = streamId;
- if (streamFeature.IsUnidirectional)
+ if (!streamFeature.CanWrite)
{
var stream = new Http3ControlStream(application, this, httpConnectionContext);
ThreadPool.UnsafeQueueUserWorkItem(stream, preferLocal: false);
diff --git a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3ControlStream.cs b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3ControlStream.cs
index 8163d65161..cca8f59837 100644
--- a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3ControlStream.cs
+++ b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3ControlStream.cs
@@ -80,7 +80,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http3
return true;
}
- // TODO make this actually close the Http3Stream by telling msquic to close the stream.
+ // TODO make this actually close the Http3Stream by telling quic to close the stream.
return false;
}
diff --git a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs
index e858ddac06..e708a89967 100644
--- a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs
+++ b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs
@@ -107,7 +107,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http3
return true;
}
- // TODO make this actually close the Http3Stream by telling msquic to close the stream.
+ // TODO make this actually close the Http3Stream by telling quic to close the stream.
return false;
}
@@ -141,7 +141,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http3
}
catch (Http3StreamErrorException)
{
- // TODO
+ // TODO
}
finally
{
@@ -151,7 +151,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http3
}
catch (Exception)
{
- // TODO
+ // TODO
}
finally
{
diff --git a/src/Servers/Kestrel/Kestrel.sln b/src/Servers/Kestrel/Kestrel.sln
index 2c80bcef71..37e7dc8ff8 100644
--- a/src/Servers/Kestrel/Kestrel.sln
+++ b/src/Servers/Kestrel/Kestrel.sln
@@ -86,7 +86,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "http2cat", "samples\http2ca
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QuicSampleApp", "samples\QuicSampleApp\QuicSampleApp.csproj", "{53A8634C-DFC5-4A5B-8864-9EF1707E3F18}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Server.Kestrel.Transport.MsQuic", "Transport.MsQuic\src\Microsoft.AspNetCore.Server.Kestrel.Transport.MsQuic.csproj", "{62CFF861-807E-43F6-9403-22AA7F06C9A6}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Server.Kestrel.Transport.Quic", "Transport.Quic\src\Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.csproj", "{62CFF861-807E-43F6-9403-22AA7F06C9A6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QuicSampleClient", "samples\QuicSampleClient\QuicSampleClient.csproj", "{F39A942B-85A8-4C1B-A5BC-435555E79F20}"
EndProject
diff --git a/src/Servers/Kestrel/NuGet.config b/src/Servers/Kestrel/NuGet.config
new file mode 100644
index 0000000000..cbdc0002cb
--- /dev/null
+++ b/src/Servers/Kestrel/NuGet.config
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/src/Servers/Kestrel/Transport.MsQuic/README.md b/src/Servers/Kestrel/Transport.MsQuic/README.md
deleted file mode 100644
index efacbcb9fa..0000000000
--- a/src/Servers/Kestrel/Transport.MsQuic/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-## Using MsQuic on Windows
-
-### Setup pre-requisites
-
-1. Update machine to the latest Windows Insiders build (build number 19010 or later). This is required for TLS 1.3 support.
-2. Copy msquic.dll and msquic.pdb to this directory and uncomment the copy task in Microsoft.AspNetCore.Server.Kestrel.Transport.MsQuic.csproj. This will copy the msquic.dll into any built project.
-
-For external contributors, msquic.dll isn't available publicly yet. See https://github.com/aspnet/Announcements/issues/393.
-
-Credit to Diwakar Mantha and the Kaizala team for the MsQuic interop code.
\ No newline at end of file
diff --git a/src/Servers/Kestrel/Transport.MsQuic/src/Internal/MsQuicApi.cs b/src/Servers/Kestrel/Transport.MsQuic/src/Internal/MsQuicApi.cs
deleted file mode 100644
index ae17ff5eb2..0000000000
--- a/src/Servers/Kestrel/Transport.MsQuic/src/Internal/MsQuicApi.cs
+++ /dev/null
@@ -1,251 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using System.Runtime.InteropServices;
-using System.Security.Cryptography.X509Certificates;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Microsoft.AspNetCore.Server.Kestrel.Transport.MsQuic.Internal
-{
- internal class MsQuicApi : IDisposable
- {
- private bool _disposed = false;
-
- private IntPtr _registrationContext;
-
- internal unsafe MsQuicApi()
- {
- var status = (uint)MsQuicNativeMethods.MsQuicOpen(version: 1, out var registration);
- MsQuicStatusException.ThrowIfFailed(status);
-
- NativeRegistration = *registration;
-
- RegistrationOpenDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.RegistrationOpen);
- RegistrationCloseDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.RegistrationClose);
-
- SecConfigCreateDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.SecConfigCreate);
- SecConfigDeleteDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.SecConfigDelete);
-
- SessionOpenDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.SessionOpen);
- SessionCloseDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.SessionClose);
- SessionShutdownDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.SessionShutdown);
-
- ListenerOpenDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.ListenerOpen);
- ListenerCloseDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.ListenerClose);
- ListenerStartDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.ListenerStart);
- ListenerStopDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.ListenerStop);
-
- ConnectionOpenDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.ConnectionOpen);
- ConnectionCloseDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.ConnectionClose);
- ConnectionShutdownDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.ConnectionShutdown);
- ConnectionStartDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.ConnectionStart);
-
- StreamOpenDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.StreamOpen);
- StreamCloseDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.StreamClose);
- StreamStartDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.StreamStart);
- StreamShutdownDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.StreamShutdown);
- StreamSendDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.StreamSend);
-
- SetContextDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.SetContext);
- GetContextDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.GetContext);
- SetCallbackHandlerDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.SetCallbackHandler);
-
- SetParamDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.SetParam);
- GetParamDelegate =
- Marshal.GetDelegateForFunctionPointer(
- NativeRegistration.GetParam);
- }
-
- internal MsQuicNativeMethods.NativeApi NativeRegistration { get; private set; }
-
- internal MsQuicNativeMethods.RegistrationOpenDelegate RegistrationOpenDelegate { get; private set; }
- internal MsQuicNativeMethods.RegistrationCloseDelegate RegistrationCloseDelegate { get; private set; }
-
- internal MsQuicNativeMethods.SecConfigCreateDelegate SecConfigCreateDelegate { get; private set; }
- internal MsQuicNativeMethods.SecConfigCreateCompleteDelegate SecConfigCreateCompleteDelegate { get; private set; }
- internal MsQuicNativeMethods.SecConfigDeleteDelegate SecConfigDeleteDelegate { get; private set; }
-
- internal MsQuicNativeMethods.SessionOpenDelegate SessionOpenDelegate { get; private set; }
- internal MsQuicNativeMethods.SessionCloseDelegate SessionCloseDelegate { get; private set; }
- internal MsQuicNativeMethods.SessionShutdownDelegate SessionShutdownDelegate { get; private set; }
-
- internal MsQuicNativeMethods.ListenerOpenDelegate ListenerOpenDelegate { get; private set; }
- internal MsQuicNativeMethods.ListenerCloseDelegate ListenerCloseDelegate { get; private set; }
- internal MsQuicNativeMethods.ListenerStartDelegate ListenerStartDelegate { get; private set; }
- internal MsQuicNativeMethods.ListenerStopDelegate ListenerStopDelegate { get; private set; }
-
- internal MsQuicNativeMethods.ConnectionOpenDelegate ConnectionOpenDelegate { get; private set; }
- internal MsQuicNativeMethods.ConnectionCloseDelegate ConnectionCloseDelegate { get; private set; }
- internal MsQuicNativeMethods.ConnectionShutdownDelegate ConnectionShutdownDelegate { get; private set; }
- internal MsQuicNativeMethods.ConnectionStartDelegate ConnectionStartDelegate { get; private set; }
-
- internal MsQuicNativeMethods.StreamOpenDelegate StreamOpenDelegate { get; private set; }
- internal MsQuicNativeMethods.StreamCloseDelegate StreamCloseDelegate { get; private set; }
- internal MsQuicNativeMethods.StreamStartDelegate StreamStartDelegate { get; private set; }
- internal MsQuicNativeMethods.StreamShutdownDelegate StreamShutdownDelegate { get; private set; }
- internal MsQuicNativeMethods.StreamSendDelegate StreamSendDelegate { get; private set; }
- internal MsQuicNativeMethods.StreamReceiveCompleteDelegate StreamReceiveComplete { get; private set; }
-
- internal MsQuicNativeMethods.SetContextDelegate SetContextDelegate { get; private set; }
- internal MsQuicNativeMethods.GetContextDelegate GetContextDelegate { get; private set; }
- internal MsQuicNativeMethods.SetCallbackHandlerDelegate SetCallbackHandlerDelegate { get; private set; }
-
- internal MsQuicNativeMethods.SetParamDelegate SetParamDelegate { get; private set; }
- internal MsQuicNativeMethods.GetParamDelegate GetParamDelegate { get; private set; }
-
- internal void RegistrationOpen(byte[] name)
- {
- MsQuicStatusException.ThrowIfFailed(RegistrationOpenDelegate(name, out var ctx));
- _registrationContext = ctx;
- }
-
- internal unsafe uint UnsafeSetParam(
- IntPtr Handle,
- uint Level,
- uint Param,
- MsQuicNativeMethods.QuicBuffer Buffer)
- {
- return SetParamDelegate(
- Handle,
- Level,
- Param,
- Buffer.Length,
- Buffer.Buffer);
- }
-
- internal unsafe uint UnsafeGetParam(
- IntPtr Handle,
- uint Level,
- uint Param,
- ref MsQuicNativeMethods.QuicBuffer Buffer)
- {
- return GetParamDelegate(
- Handle,
- Level,
- Param,
- out Buffer.Length,
- out Buffer.Buffer);
- }
-
- public async ValueTask CreateSecurityConfig(X509Certificate2 certificate)
- {
- QuicSecConfig secConfig = null;
- var tcs = new TaskCompletionSource