ServicePointManager SecurityProtocol

Could not create SSL/TLS secure channel

Have you ever came across the following error 'The request was aborted: Could not create SSL/TLS secure channel' when trying to connect to a remote website.

In this quick post, I'll show you how when I came across this problem I was able to fix it.

The problem normally occurs when your server only offers SSLv3 and TLSv10, but the client you are connecting to needs TLSv12.

Because of this, you need to ensure that the server and client have a common protocol supported.

The way I fix this problem is with the following line of code below, just above the code that makes the remote call, for example, a HttpWebRequest or WebClient.

Code
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

Summary

In this quick post, I explained how you can get the 'The request was aborted Could not create SSL/TLS secure channel' error and how to fix the problem.

I hope you found this blog helpful and if you have any comments, please use the form below.

Blog Form

 Please complete the required fields (*required)

 *
*