Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only select TLS1.2 when non-default SecurityProtocol selected. #5

Merged
merged 1 commit into from
Nov 29, 2018

Conversation

grokys
Copy link

@grokys grokys commented Nov 29, 2018

grokys added a commit to github/VisualStudio that referenced this pull request Nov 29, 2018
Copy link

@jcansdale jcansdale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add a comment about what the fix does.

@@ -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)
Copy link

@jcansdale jcansdale Nov 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took me a little while to understand what's going on here (thanks for the explanation).

Maybe we should add a comment that 0 corresponds to SecurityProtocolType.SystemDefault, which is new in .NET 4.7 (with a link to https://docs.microsoft.com/en-us/dotnet/api/system.net.securityprotocoltype?view=netframework-4.7). If I've understood correctly, the SystemDefault will default to using TLS 1.2.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this is a fork, I expect that this change will be overwritten by the upstream change when that is made, so I expect this change to be shortlived. The issue opened on octokit.net by MS suggests using 0 so I expected that they will make a similar change; therefore I'm not sure it's worth calling it out here.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this was going to end up a PR to upstream as well.

I'll ✔️ as is. 👍

@jcansdale jcansdale merged commit 9b5dd70 into GHfVS Nov 29, 2018
@jcansdale jcansdale deleted the fixes/2088-octokit-tls branch November 29, 2018 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants