Skip to content

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

@melucas

Description

@melucas

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions