[Solved] The request was aborted: Could not create SSL/TLS secure channel

0
(0)

[Solved] The request was aborted: Could not create SSL/TLS secure channel

Error: The request was aborted: Could not create SSL/TLS secure channel
Solution:
Add Following code before calling any Secure API or any Secure Web URL.

ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

Example:

ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
new WebClient().DownloadData("https://websiteurl.com/method...");

ServicePoint Class:
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 Class:
ServicePointManager is a static class used to create, maintain, and delete instances of the ServicePoint class.
Ref: https://msdn.microsoft.com/en-us/library/system.net.servicepointmanager(v=vs.110).aspx

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

As you found this post useful...

Share this post on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?