Skip to content
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

Tls 1.2 Override for Windows 7 to fix: Failed to get the latest build version from GitHub: #140

Open
melucas opened this issue Mar 20, 2022 · 0 comments

Comments

@melucas
Copy link

melucas commented Mar 20, 2022

Sometime in January Cumulus MX stopped checking for updates via GitHub e.g. Cumulus.GetLatestVersion().

This must be related to the TLS 1.0 and 1.1 deprecation Microsoft implemented.
I tried the registry hacks to disable TLS 1.0 and 1.1 and for TLS 1.2. However, that did not resolve the issue.

Setting the TLS version in the GetLastestVersion() solved the problem:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls13;

I created the following method to check if the version of Windows is 7.

private bool RequiresTls12Override() { if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return false;
}

var osVersion = Environment.OSVersion;
var version = osVersion.Version;

if ($"{version.Major}.{version.Minor}" == "6.1")
{
	// Windows 7 or Windows 2008 R2
	return true;
}

return false;

}
`
Then in GetLatestVersion() after the var http = new HttpClient(); line, I added:

if (RequiresTls12Override()) { ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls13; }

Is this something that could be implemented in an upcoming release? I don't have a Mac or Linux install to test the change with.

Thank you,
Michael

CodeSnippets.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant