Skip to content
This repository has been archived by the owner on Feb 27, 2025. It is now read-only.

Disabling TLS 1.0 via ServicePointManager may cause side-effects #5

Open
HughJeffner opened this issue Sep 21, 2017 · 2 comments
Open

Comments

@HughJeffner
Copy link

Specifically this bit of code:

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

This setting global to the app domain so if your application connects to other services that do not support TLS 1.1/1.2 then you will get an exception:

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

Not sure if there is anything to be done here but I wanted to make a note of this because it took me several hours of troubleshooting to trace the fault back to this library. I was previously using an older version without the change and updated to the most current version.

I would think if the payment gateway had TLS 1.0 disabled server-side then .NET would use TLS 1.1+ to negotiate the connection but that code was put there for a reason and I am not sure why.

@securesubmit-buildmaster
Copy link
Contributor

@ensemblebd
Copy link

ensemblebd commented Nov 6, 2018

I'm encountering this as well.
When submitting payment, even if you specify a multiplicity of connection support, the error is achieved.

System.Net.ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 || SecurityProtocolType.Tls12

For me this is presently critical. If I can locate a solution I'll post back. Not sure if anyone else has switched to 1.2?


Edit: Resolved by ensuring web.config had a value for targetFramework="4.6.1", default is 4.5.2.
Compilation framework of 4.6.1 results in proper binary compilation with reference to TLS12 property, but web runtime of 4.5.2 doesn't offer that it would seem?
I still have to force the value to Tls12, even though I'd rather have support for multiple.
So I just swap it as a "wrapping execution" for heartland payments.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants