SparkleNetworks / LinkedInNET

Sparkle.LinkedInNET will help you query the LinkedIn API with C# :)
https://www.nuget.org/packages/Sparkle.LinkedInNET/
GNU Lesser General Public License v3.0
35 stars 51 forks source link

Getting "Authentication failed because the remote party has closed the transport stream" #24

Closed saravanan1983 closed 4 years ago

saravanan1983 commented 6 years ago

Hi,

Thanks for the client we are using it for more than 1 year, it was working till last week. suddenly we are getting "Authentication failed because the remote party has closed the transport stream" while getting the token, do we need to change any thing on this front.

this is the line where we are getting issue. await api.OAuth2.GetAccessTokenAsync(code, redirectUrl)

kenpi04 commented 6 years ago

Hi, I have faced this issue, You can try add this line on below before call this method.

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

AlexTalcura commented 6 years ago

We had the same issue and this fix with ServicePointManager.SecurityProtocol helped a lot!

sandrock commented 6 years ago

On https://developer.linkedin.com/docs we can read

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.

So you shall use:

ServicePointManager.SecurityProtocol = ServicePointManager.SecurityProtocol | SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11;
sandrock commented 4 years ago

This project is not maintained any more. Please check the README page to find alternatives.