From c6c725b1a0ecf23a1c022c6b6b4e4e8c2d84e546 Mon Sep 17 00:00:00 2001 From: Jesse Date: Fri, 27 Sep 2019 12:17:14 +0200 Subject: [PATCH] Finally fixed win7 SSL framework compatibility. --- TwilightBoxart.UX/Program.cs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/TwilightBoxart.UX/Program.cs b/TwilightBoxart.UX/Program.cs index a1bae94..61002cc 100644 --- a/TwilightBoxart.UX/Program.cs +++ b/TwilightBoxart.UX/Program.cs @@ -1,4 +1,5 @@ using System; +using System.Net; using System.Windows.Forms; namespace TwilightBoxart.UX @@ -11,6 +12,37 @@ static class Program [STAThread] static void Main() { + // Possible windows XP / 7 / older .net framework compatibility fix. + try + { + ServicePointManager.Expect100Continue = true; + ServicePointManager.SecurityProtocol = (SecurityProtocolType)48 // SSl3 + | (SecurityProtocolType)192 // tls + | (SecurityProtocolType)768 // tls11 + | (SecurityProtocolType)3072 // tls12 + | (SecurityProtocolType)12288; // tls13 + } + catch + { + try // Try without tls13 + { + ServicePointManager.SecurityProtocol = (SecurityProtocolType)48 // SSl3 + | (SecurityProtocolType)192 // tls + | (SecurityProtocolType)768 // tls11 + | (SecurityProtocolType)3072; // tls12 + } + catch + { + try // Try without tls12 + { + ServicePointManager.SecurityProtocol = (SecurityProtocolType)48 // SSl3 + | (SecurityProtocolType)192 // tls + | (SecurityProtocolType)768; // tls11 + } + catch { } + } + } + Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm());