From 6e53b787d3c0a6be7fbada7586c7cad719998f9c Mon Sep 17 00:00:00 2001 From: Jaex Date: Mon, 12 Oct 2020 14:00:07 +0300 Subject: [PATCH] Workaround to support TLS 1.2 on Windows 7 --- ShareX.UploadersLib/BaseUploaders/Uploader.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ShareX.UploadersLib/BaseUploaders/Uploader.cs b/ShareX.UploadersLib/BaseUploaders/Uploader.cs index 3768df445..ee531f0de 100644 --- a/ShareX.UploadersLib/BaseUploaders/Uploader.cs +++ b/ShareX.UploadersLib/BaseUploaders/Uploader.cs @@ -58,6 +58,18 @@ public static void UpdateServicePointManager() ServicePointManager.DefaultConnectionLimit = 25; ServicePointManager.Expect100Continue = false; ServicePointManager.UseNagleAlgorithm = false; + + if (Helpers.IsWindows7()) + { + try + { + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; + } + catch (NotSupportedException) + { + DebugHelper.WriteLine("Unable to configure TLS 1.2 as the default security protocol."); + } + } } protected void OnProgressChanged(ProgressManager progress)