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
fix TLS13 procesing on windows #34181
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -114,7 +114,7 @@ public static bool IsNonZeroLowerBoundArraySupported | |||||
public static bool SupportsClientAlpn => SupportsAlpn || (IsOSX && PlatformDetection.OSXVersion > new Version(10, 12)); | ||||||
|
||||||
// OpenSSL 1.1.1 and above. | ||||||
public static bool SupportsTls13 => !IsWindows && !IsOSX && (OpenSslVersion.CompareTo(new Version(1,1,1)) >= 0); | ||||||
public static bool SupportsTls13 => GetTls13Support(); | ||||||
|
||||||
private static Lazy<bool> s_largeArrayIsNotSupported = new Lazy<bool>(IsLargeArrayNotSupported); | ||||||
|
||||||
|
@@ -204,6 +204,38 @@ private static bool GetSsl3Support() | |||||
return (IsOSX || (IsLinux && OpenSslVersion < new Version(1, 0, 2) && !IsDebian)); | ||||||
} | ||||||
|
||||||
private static bool GetTls13Support() | ||||||
{ | ||||||
if (IsWindows) | ||||||
{ | ||||||
if (!IsWindows10Version2004OrGreater) | ||||||
{ | ||||||
return false; | ||||||
} | ||||||
|
||||||
string clientKey = @"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Client"; | ||||||
string serverKey = @"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Server"; | ||||||
|
||||||
object client, server; | ||||||
try | ||||||
{ | ||||||
client = Registry.GetValue(clientKey, "Enabled", null); | ||||||
server = Registry.GetValue(serverKey, "Enabled", null); | ||||||
if (client is int c && server is int s) | ||||||
{ | ||||||
return c == 1 && s == 1; | ||||||
} | ||||||
} | ||||||
catch { }; | ||||||
// assume no if key is missing or on error. | ||||||
return false; | ||||||
} | ||||||
else | ||||||
{ | ||||||
return !IsOSX && (OpenSslVersion.CompareTo(new Version(1,1,1)) >= 0); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be a little bit more understandable as:
Suggested change
|
||||||
} | ||||||
} | ||||||
|
||||||
private static bool GetIsRunningOnMonoInterpreter() | ||||||
{ | ||||||
// This is a temporary solution because mono does not support interpreter detection | ||||||
|
This file contains 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
This file contains 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
This file contains 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
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.
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.
macOS doesn't support TLS 1.3 on any version?
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 in .NET. Tracked by #1979
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.
In that case can you please change this to something like:
? Thanks.