nemiro-net / nemiro.oauth

Nemiro.OAuth is a class library for authorization via OAuth protocol in .NET Framework

Home Page:http://oauth.nemiro.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Don't force TLS 1.0

nico159 opened this issue · comments

Hi,

In ExecuteRequest nemiro.oauth is forcing the use of TLS 1.0 as security protocol.
This make impossible to connect to web servers that only support TLS 1.1/1.2 failing with "An existing connection was forcibly closed by the remote host".

One quick fix is simply replacing that line with:
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls;
So that it will allow TLS 1.0 while still keeping the other protocols enabled.

But I think that don't enabling TLS 1.0 at all would be the a wiser way to go. I don't think that a library should touch ServicePointManager.SecurityProtocol.

I will check it.

Unfortunately now there is no time and I can not say when the result will be.

Thank you for message.

This must be why linkedin has stopped working! https://developer.linkedin.com/docs/guide/v2/concepts/authentication

Starting 10 October 2017 developers must use TLS 1.1 or 1.2 when calling LinkedIn APIs. LinkedIn no longer supports TLS 1.0 for security reasons.

Any chance of fixing this anytime soon?

commented

I wonder if the TLS 1.2 protocol issue was ever resolved for LinkedIn login...
When I try the LinkedIn login - after user approves/authorizes I get an error message:
"The request was aborted: could not create SSL/TLS secure channel."

I tried to comment the line:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;

I also tried this:
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls;
and tried to use a real numeric value 3072, which is enumeration value for TLS 1.2
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;

However, it did not resolve the issue...
Any ideas/solutions?

EDIT: Correction - after recompiling either of the lines in bold above works!

Anytime this will get fixed?

Still doesn't work. More and more services are TLS 1.2 only so this is a real show-stopper

Guys, its pretty easy to fix by yourself: File: OAuthUtility.cs, Line around 495

var securityProtocol = ServicePointManager.SecurityProtocol;

  ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;