Ver Fonte

Switch from Ssl 3.0 | Tls 1.0 | Tls 1.1 to Tls 1.0 | Tls 1.1 | Tls 1.2

GitHub switched exclusively to TLS 1.2 (to avoid POODLE) which isn't enabled by
default in this version of .NET, which broke auto-upgrades. This allows newer
clients to auto-upgrade from GitHub
Antony Male há 7 anos atrás
pai
commit
1e1e876ce3
1 ficheiros alterados com 5 adições e 0 exclusões
  1. 5 0
      src/SyncTrayzor/Bootstrapper.cs

+ 5 - 0
src/SyncTrayzor/Bootstrapper.cs

@@ -26,6 +26,7 @@ using SyncTrayzor.Services.Metering;
 using System.Reflection;
 using SyncTrayzor.Localization;
 using SyncTrayzor.Services.Ipc;
+using System.Net;
 
 namespace SyncTrayzor
 {
@@ -86,6 +87,10 @@ namespace SyncTrayzor
 
         protected override void Configure()
         {
+            // GitHub uses Tls 1.2 only, and it isn't enabled by default before .NET 4.6. Since we target an earlier
+            // .NET version, we have to enable this ourselves.
+            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
+
             this.options = this.Container.Get<CommandLineOptionsParser>();
             if (!this.options.Parse(this.Args))
                 Environment.Exit(0);