question

AbhinavMutreja-0310 avatar image
0 Votes"
AbhinavMutreja-0310 asked DanielZhang-MSFT edited

The SSL connection could not be established

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;

dotnet-aspnet-core-general
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Use a tool like Wireshark to analyze TLS handshakes.

0 Votes 0 ·

0 Answers