Skip to content

Commit

Permalink
Force TLS 1.2 on Full Framework
Browse files Browse the repository at this point in the history
  • Loading branch information
russcam committed Oct 22, 2020
1 parent 3b0c78c commit 355ddd1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Elastic.Apm.Specification/Validator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ public async Task DownloadAsync(string branch, bool overwrite)
}

using var client = new HttpClient();
#if !NETSTANDARD
// force use of TLS 1.2 on older Full Framework, in order to call GitHub API
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
#endif

client.DefaultRequestHeaders.UserAgent.Clear();
client.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue("apm-agent-dotnet", "1"));

Expand Down

0 comments on commit 355ddd1

Please sign in to comment.