The SSL connection could not be established

Abhinav Mutreja 1 Reputation point
2021-04-20T07:01:43.607+00:00

Facing the below error while invoking a TLS enabled REST API by .NetCore 3.1 HttpClient using client certificates.

The Curl command using client certificates works perfectly fine.

ERROR -

The SSL connection could not be established, see inner exception.

Inner Exception 1:
IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..

Inner Exception 2:
SocketException: An existing connection was forcibly closed by the remote host.


I tried below options to resolve the issue but no success.

  1. System.Net.ServicePointManager.Expect100Continue = false;
  2. System.Net.ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,553 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.