The request was aborted: Could not create SSL/TLS secure channel.

Hi,

We have this card payment function on our webpage. Now the vendor has upgraded so that they don't support TLS 1.0 and SSL 3.0. Obviously we make a request with those protocols so we get this error:

The request was aborted: Could not create SSL/TLS secure channel.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
 
Exception Details: System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.
The request was aborted: Could not create SSL/TLS secure channel.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
 
Exception Details: System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.

Open in new window


I've checked and seen that the server (Windows server 2012) has framework 4.5.2 installed, and also the asp.net project is targeted to the same framework. If I understand it rightly this is what is required. Still I get this error. Do I have to disable the protocols, if so how? Or is there any other issues I need to solve?

Thanks for help!

Peter
Peter NordbergIT ManagerAsked:
Who is Participating?
 
Snarf0001Commented:
Not quite all that is needed.  In 4.5, Tls1 and SSL3 are still the default values when you're making external requests.

You need to enable them on the ServicePointManager.Security protocol, in Global.asax
protected void Application_Start()
{
	//other code

	ServicePointManager.SecurityProtocol = ServicePointManager.SecurityProtocol | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
}

Open in new window


This will enable the proper protocols, while still leaving ssl3 and tls1 enabled as well.  Usually this is enough, and is a nice catch-all in case any old vendors still DON'T implement 1.1 / 1.2.

If you still have problems, then try leaving it as only 1.1 and 1.2:
protected void Application_Start()
{
	//other code

	ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
}

Open in new window

0
 
Peter NordbergIT ManagerAuthor Commented:
Thanks, Worked perfectly!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.