Other day, we were getting following error while calling SSL enables 3rd party API from C# console.
The request was aborted: Could not create SSL/TLS secure channel
Fix:
- Add below statement before making your API call, which validates the SSL certification.
ServicePointManager.ServerCertificateValidationCallback = delegate (object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
return true;
};
- Include following namespaces
using System.Security.Cryptography.X509Certificates;
using System.Net.Security;
🙂

![[Step by Step] Beginner : Create a PCF control and add it to a custom page](https://rajeevpentyala.com/wp-content/uploads/2024/12/image-49.png)

Leave a comment