From 847b8cd7f9e83ccf8f52e775d2467a4923501b6f Mon Sep 17 00:00:00 2001 From: Piotrekol Date: Thu, 22 Feb 2018 21:19:17 +0100 Subject: [PATCH] Updater fix: Force usage of TLS1.2 --- osu!StreamCompanion/Code/Modules/Updater/Updater.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu!StreamCompanion/Code/Modules/Updater/Updater.cs b/osu!StreamCompanion/Code/Modules/Updater/Updater.cs index e299eec9..ffb74a83 100644 --- a/osu!StreamCompanion/Code/Modules/Updater/Updater.cs +++ b/osu!StreamCompanion/Code/Modules/Updater/Updater.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Net; using System.Threading; using Newtonsoft.Json.Linq; using osu_StreamCompanion.Code.Interfaces; @@ -19,6 +20,7 @@ class Updater : IModule, IMainWindowUpdater public bool Started { get; set; } public void Start(ILogger logger) { + ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; //Force usage of TLS1.2 when possible. Started = true; CheckForUpdates(); } @@ -131,7 +133,7 @@ private string GetStringData(string url) { using (var wc = new ImpatientWebClient()) { - wc.Headers.Add("user-agent", "StreamCompanion_Updater"); + wc.Headers.Add("user-agent", "StreamCompanion_Updater_" + Program.ScVersion); contents = wc.DownloadString(url); } }