I'm not sure why you are reading the cert from disk every time (this may be the issue if concurrent requests). why not cache?
How to troubleshoot the exception, Could not create TLS secure channel?
Hello there,
I have this C# code that consumes a SOAP WS and it was working properly for years. However, since recently it started to throw the following exception:
The request was aborted: Could not create SSL/TLS secure channel.
Basically it imports the certificate FILE (.pfx) needed for authentication.
request.ClientCertificates.Add(new X509Certificate(certificateFile, certPassword));
Well, it works 9 times as expected and then the 10th time it will not add the certificate. This results in getting Error 403 (Forbidden).
Honestly, I have no clue how to troubleshoot this issue especially because it happens only sporadically.
I checked the IIS Logs and found nothing helpful.
Your comments and suggestions would be greatly appreciated.