Skip to content

Commit

Permalink
Only select TLS1.2 when non-default SecurityProtocol selected.
Browse files Browse the repository at this point in the history
  • Loading branch information
grokys committed Nov 29, 2018
1 parent ed39ffc commit 471146b
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 471146b

Please sign in to comment.