Skip to content

Commit

Permalink
Merge pull request #5 from editor-tools/fixes/2088-octokit-tls
Browse files Browse the repository at this point in the history
Only select TLS1.2 when non-default SecurityProtocol selected.
  • Loading branch information
jcansdale authored Nov 29, 2018
2 parents ed39ffc + 471146b commit 9b5dd70
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Octokit/Http/HttpClientAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ public HttpClientAdapter(Func<HttpMessageHandler> getHandler)
Ensure.ArgumentNotNull(getHandler, nameof(getHandler));

#if HAS_SERVICEPOINTMANAGER
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;
if (ServicePointManager.SecurityProtocol != 0)
{
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;
}
#endif

_http = new HttpClient(new RedirectHandler { InnerHandler = getHandler() });
Expand Down

0 comments on commit 9b5dd70

Please sign in to comment.