-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[QUIC] Add Windows version check to QUIC initialization #54488
[QUIC] Add Windows version check to QUIC initialization #54488
Conversation
Tagging subscribers to this area: @dotnet/ncl Issue DetailsI took the version number from our QUIC readme (OS Build 20145.1000) Fixes #32575
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -121,6 +123,12 @@ private MsQuicApi(NativeApi* vtable) | |||
|
|||
static MsQuicApi() | |||
{ | |||
if (OperatingSystem.IsWindows() && !IsWindowsVersionSupported()) | |||
{ | |||
IsQuicSupported = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add trace message in case we need to debug it the field? Or is this going to be documented when we have QUIC API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I guess it makes sense to log current and min supported version here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I guess there is no reliable way to get current Windows version, that's why #32575 was created in the first place. I will only log min supported version then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Environment.OSVersion
was changed to report current OS version as part of .NET 5. Should be safe to use if the desire is still there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nibanks is MsQuic tracking a minimum Windows version?
We should make sure whatever version we set this to, we actually test on. We've probably only been testing with latest dev channel.
@@ -9,6 +9,8 @@ namespace System.Net.Quic.Implementations.MsQuic.Internal | |||
{ | |||
internal unsafe sealed class MsQuicApi | |||
{ | |||
private static readonly Version MinWindowsVersion = new Version(10, 0, 20145, 1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not much worth in a field since it is only initialized and accessed once. A property is fine.
private static readonly Version MinWindowsVersion = new Version(10, 0, 20145, 1000); | |
private static Version MinWindowsVersion => new Version(10, 0, 20145, 1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually accessed 4 times on check and 5th time on logging...
@@ -121,6 +123,12 @@ private MsQuicApi(NativeApi* vtable) | |||
|
|||
static MsQuicApi() | |||
{ | |||
if (OperatingSystem.IsWindows() && !IsWindowsVersionSupported()) | |||
{ | |||
IsQuicSupported = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Environment.OSVersion
was changed to report current OS version as part of .NET 5. Should be safe to use if the desire is still there.
Not specifically we aren't. The TLS dependency is the biggest issue. If you use Schannel, Windows Server 2022 is probably the earliest you can officially support. If you used OpenSSL, you can go back at least as far as Windows Server 2019, likely 2016. There are performance differences as you use newer Windows OS builds (at the UDP layer) but no absolute requirements (beyond TLS). |
Yep, I use Insider Preview that is constantly updating - forcibly - so I cannot fix the Windows version on my side. Do you see any other options? @scalablecory |
Are you trying to focus on a client or server build of Windows? I believe Insiders is the only option for client right now. For server, 2022 is the way to go. |
@nibanks Pardon my ignorance, but what would be the difference between Windows client vs server build with respect to QUIC? I would expect it to work on both of them (as Kestrel uses the same library). I also don't know how the versions coincide between client and server builds, API |
Beyond having different release dates (and therefore one is more recent than the other), they sometimes have different features enabled by default or default tuning constants. Also, Windows Server 2022 is the only existing (almost) released Windows build that could practically be used, and I was making sure that was Ok. |
It seems that there is no API in .NET to distinguish server vs workstation OS build. We need to agree on what version to put here, given that both server and workstation Windows builds seem to have interchanging numbering. We also need to decide whether we actually want to find the earliest build number QUIC will work on, or for now just to be sure that starting from build X it's definitely ok and what's earlier we don't care. I don't think the first way is worth the effort as all the working builds are previews anyway at this point. Workstation build I have right now is 21390; I see here https://www.microsoft.com/en-us/software-download/windowsinsiderpreviewserver that server build is 20344. Options I see for now:
|
I would use 20145.1000 from these reasons:
|
I agree with @karelz. This is minimal check e.g. this does not represent best or supported configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read about 10.0.20170 for client is the first version having SChannel TLS 1.3 enabled by default, not sure if there is anything between the 20145 server and that. |
Nevertheless, since the OpenSSL version of |
That could be fixed. But OpenSSL on Windows is not going to be supported configuration @wegylexy. (at least not from .NET prospective) |
How about SChannel with TLS 1.3 in the next Windows 10 public release? Many CPUs are too old to run Windows 11. |
@wegylexy that is not a decision we can influence -- I would recommend to follow up with feedback channel for Windows directly. |
I took the version number from our QUIC readme (OS Build 20145.1000)
Fixes #32575