Skip to content

Commit

Permalink
Fix TLS issue
Browse files Browse the repository at this point in the history
Fixes a TLS issue with more modern webservers by forcing the .NET security policy.
  • Loading branch information
canihavesomecoffee authored Sep 26, 2022
1 parent d2d9d35 commit b41bc0a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CCExtractorTester/Comparers/ServerComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.Generic;
using System;
using System.Text;
using System.Net;
using System.Globalization;

namespace CCExtractorTester.Comparers
Expand All @@ -28,6 +29,7 @@ public UploadFile()

private byte[] UploadFiles(string address, IEnumerable<UploadFile> files, NameValueCollection values)
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
var request = WebRequest.Create(address);
request.Method = "POST";
var boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x", NumberFormatInfo.InvariantInfo);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit b41bc0a

Please sign in to comment.