Skip to content

Commit

Permalink
Finally fixed win7 SSL framework compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
KirovAir committed Sep 27, 2019
1 parent 6d2c27b commit c6c725b
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions TwilightBoxart.UX/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Net;
using System.Windows.Forms;

namespace TwilightBoxart.UX
Expand All @@ -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());
Expand Down

0 comments on commit c6c725b

Please sign in to comment.