From b41bc0ac4c07f9597211f97798fdf323f7f12de0 Mon Sep 17 00:00:00 2001 From: Willem Date: Mon, 26 Sep 2022 19:10:55 +0000 Subject: [PATCH] Fix TLS issue Fixes a TLS issue with more modern webservers by forcing the .NET security policy. --- CCExtractorTester/Comparers/ServerComparer.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CCExtractorTester/Comparers/ServerComparer.cs b/CCExtractorTester/Comparers/ServerComparer.cs index bdedb40..8800e98 100644 --- a/CCExtractorTester/Comparers/ServerComparer.cs +++ b/CCExtractorTester/Comparers/ServerComparer.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System; using System.Text; +using System.Net; using System.Globalization; namespace CCExtractorTester.Comparers @@ -28,6 +29,7 @@ public UploadFile() private byte[] UploadFiles(string address, IEnumerable files, NameValueCollection values) { + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; var request = WebRequest.Create(address); request.Method = "POST"; var boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x", NumberFormatInfo.InvariantInfo); @@ -131,6 +133,7 @@ public void CompareAndAddToResult(CompareData data) else { // Post equality status + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; using (var wb = new WebClient()) { wb.Headers.Add("user-agent", userAgent); @@ -173,6 +176,7 @@ public string SaveReport(string pathToFolder, ResultData data) public void SendExitCodeAndRuntime(RunData rd, int testId) { // Post equality status + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; using (var wb = new WebClient()) { var d = new NameValueCollection();