3

I know similar questions have been asked, but my problem seems to be different, as I have tried many of the solutions I have found on the web. My problem is as following.

I'm running a .net 4.5.1 MVC application installed on IIS 7, which makes secure outbound requests to an external server supporting only TLS 1.2. All goes fine when i run the application from Windows 7 host, but on Windows Server 2008 R2 is fils with:

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

In the beginning it was failing also on my local Windows 7, until I added this line before the WebRequest and worked:

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

But this didn't make it work on the server.

I also tried adding:

ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(AllwaysGoodCertificate);
ServicePointManager.Expect100Continue = true;

But didn't make any changes.

I also tried on the server to add TLS 1.2 protocol to be accepted, as explained here https://support.quovadisglobal.com/KB/a433/how-to-enable-tls-12-on-windows-server-2008-r2.aspx

Restarted the machine, but still nothing new.

Thank you very much in advance, I'm getting quite desperate with this issue :S

Holmix
  • 62
  • 7

1 Answers1

0

I solved it changing this line

    System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

for this

    System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
Holmix
  • 62
  • 7