Skip to content

Commit

Permalink
Fix DownloadResource()
Browse files Browse the repository at this point in the history
Set multiple security protocols to prevent "Could not create SSL/TLS secure channel." error. Tls1, Tls1.1, Tls1.2, Tls1.3
  • Loading branch information
123DMWM committed Dec 2, 2019
1 parent 1863af1 commit 9070445
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fCraft/System/Server.cs
Expand Up @@ -479,6 +479,8 @@ public static partial class Server {
}

static void DownloadResource(string url, string file) {
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = (SecurityProtocolType)(0xc0 | 0x300 | 0xc00 | 0x3000);
if (File.Exists(file)) return;

try {
Expand Down

0 comments on commit 9070445

Please sign in to comment.