The SSL connection could not be established
Abhinav Mutreja
1
Reputation point
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.
- System.Net.ServicePointManager.Expect100Continue = false;
- System.Net.ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;
Sign in to answer