Start a new topic

Remote party has closed the transport stream exception

Get "Authentication failed because the remote party has closed the transport stream." exception when I call the following code: 

Subscription.Retrieve(subscriptionId).Request()

 Stack trace:


   at ChargeBee.Api.ApiUtil.SendRequest(HttpWebRequest request, HttpStatusCode& code)

   at ChargeBee.Api.ApiUtil.GetJson(String url, Params parameters, ApiConfig env, Dictionary`2 headers, HttpStatusCode& code, Boolean IsList)

   at ChargeBee.Api.ApiUtil.Get(String url, Params parameters, Dictionary`2 headers, ApiConfig env)

   at ChargeBee.Api.EntityRequest`1.Request(ApiConfig env)

   at ChargeBee.Api.EntityRequest`1.Request()

   at PrimeThree.Core.Services.SubscriptionService.<IsWithinPlanThresholdAsync>d__13.MoveNext() in E:\UpWork\Clients\Michael Wilson\PrimeThreeApp.Core\PrimeThree.Core.Services\SubscriptionService.cs:line 137

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()

   at PrimeThree.Core.Api.Attributes.CheckStorageThresholdAttribute.<OnActionExecutingAsync>d__2.MoveNext() in E:\UpWork\Clients\Michael Wilson\PrimeThreeApp.Core\PrimeThree.Core.Api\Attributes\CheckStorageThresholdAttribute.cs:line 41



1 Comment

Hi Sergey

This error indicates that the API call was made via TLS v1.0/1.1 protocol which is no longer supported by Chargebee. The simple fix is to explicitly define the TLS protocol by using the below config prior to any CB .NET package:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

Hope this helps!

Login or Signup to post a comment