My company had some dotNET code which has been talking to Twitter's API happily over the last three months, tweeting our news out.
On 29th July it stopped working, and the POST request was hit with this error:
An existing connection was forcibly closed by the remote host
System.Net.Sockets.SocketException
I assume this is because our server is still using TLS 1.1 and I only just found this Twitter API announcement from June, which says:
Since the removal of SSL support 104 in 2014, the Twitter API has required a minimum of TLS 1.0 for all incoming connections. Both TLS 1.0 and 1.1 were superseded by TLS 1.2 in 2008.
Beginning July 25th 2019, all connections to the Twitter API (and all other Twitter domains) will require TLS 1.2. This change will affect all formats and tiers of the API (REST, streaming, and webhooks; standard, premium, enterprise, and Ads and Media APIs), as well as the wider Twitter platform.
It seems we got 4 days grace, as our code had no problems between 25th and 28th July.
I believe the server itself has TLS 1.2 installed, so perhaps the issue is that this project was compiled with dotNET 4.0 which defaults to using TLS 1.1?
Will upgrading our project to dotNET 4.5 solve the problem, or could it be something else?