[Solved] The request was aborted: Could not create SSL/TLS secure channel
Error: The request was aborted: Could not create SSL/TLS secure channel
Add Following code before calling any Secure API or any Secure Web URL.
ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; new WebClient().DownloadData("https://websiteurl.com/method...");
The ServicePoint class handles connections to an Internet resource based on the host information passed in the resource’s Uniform Resource Identifier (URI). The initial connection to the resource determines the information that the ServicePoint object maintains, which is then shared by all subsequent requests to that resource. Ref: https://msdn.microsoft.com/en-us/library/system.net.servicepoint(v=vs.110).aspx
ServicePointManager is a static class used to create, maintain, and delete instances of the ServicePoint class.
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?