Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TLS upgrade #164

Open
jasonwuonline opened this issue Jul 3, 2018 · 5 comments
Open

TLS upgrade #164

jasonwuonline opened this issue Jul 3, 2018 · 5 comments

Comments

@jasonwuonline
Copy link

Might need to add
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls11 | System.Net.SecurityProtocolType.Tls12;

for the system to use the new TLS version

@lichutin
Copy link

lichutin commented Jul 3, 2018

It may be better to set SecurityProtocol on your code than inside SparkPost library.
Another solution is to upgrade .NET framework version.
Transport Layer Security (TLS) best practices with the .NET Framework

@aaronclausen
Copy link

Grrr!!! Thanks Jason for the code, I had to put this above anywhere I was using the SparkPost CSharp nuget package code to send emails, as my emails have been getting lost for almost a week!!!

@ohine
Copy link

ohine commented Jul 31, 2018

@aaronclausen I second your Grrrr! If this is required to function, it needs to be handled in the library. Ran into this one today as well on our account.

@LatoSoftware
Copy link

Third Grrrr!!!!!

@ta-stott-oe
Copy link

Thanks for this @jasonwuonline .

Before, when I called Sparkpost.Client.Transmissions.Send(), I was getting a System.Net.Sockets.SocketException with An existing connection was forcibly closed by the remote host.

Adding the following fixed it and allowed the email to be sent successfully.
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls11 | System.Net.SecurityProtocolType.Tls12;

... some omitted details which are specific to my code

Inner Exception 2:
HttpRequestException: An error occurred while sending the request.

Inner Exception 3:
WebException: The underlying connection was closed: An unexpected error occurred on a send.

Inner Exception 4:
IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

Inner Exception 5:
SocketException: An existing connection was forcibly closed by the remote host

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

No branches or pull requests

6 participants