I am suddenly getting this error when posting a tweet the request was aborted could not create SSL/TLS secure channel

Aug 3, 2013 at 3:42 PM
I have a web app that posts to twitter and I get this intermittent error from twitter


twitterexception message "no message from twitter"

And this is the Inner Exception
"the request was aborted could not create SSL/TLS secure channel"

httperror
"Secure Channel Error" - httpError

if any of you rock stars can shed some light that would be fantastic!!

code on!!

Legionaire
Coordinator
Aug 3, 2013 at 5:07 PM
Hi,

Is this Web Forms or MVC?
What OS are you running on?
Which authorizer are you using?

@JoeMayo
Aug 8, 2013 at 3:44 PM
We also got this error twice: Both times on August 2. At around 1:50 AM and 5:15 PM. Many tweets since without issue, however ~ 20 a day.

Running Web Forms on Windows 2003 Server. Using SingleUserAuthorizer, and the current version of LINQ to Twitter v2.1.08
Sep 26, 2013 at 10:05 AM
Also same issue since 24th September.

Application: ASP.Net Web Forms (HTTP:80 only)
Server: Windows Server 2012 (Windows Azure Virtual Machine)
Authorizer: WebAuthorizer with InMemoryCredentials

I noticed that this issue happens 25% of the time, but when the issue happens, if you refresh the page and try again, it keeps happening.
My application is not using SSL, all my requests are HTTP.

I found this article on the Twitter blog: Streaming SSL certificate updates.
As I understand this change only applies to exisitng applications using SSL, so that shouldn't be the cause of the problem.

Any idea?
Coordinator
Sep 26, 2013 at 4:11 PM
Thanks for letting me know. Without being able to reproduce, my ability to learn the cause of the problem is limited. I'll keep a look out to see I encounter this problem myself.

@JoeMayo
Sep 27, 2013 at 10:55 AM
Edited Sep 27, 2013 at 10:57 AM
Thanks Joe for your hard work.

My issue seems to be fixed.
I noticed that when you update a single file in IIS (unrelated to Twitter, a stylesheet or a view for example), you may get the exception mentioned above.
This is unbelievable, but something strange should happen in IIS and break 25% of Linq2Twitter queries, and Facebook / Google+ were working as expected.

@JoeMayo:
This StackOverflow answer my help to bypass the issue in Linq2Twitter.
This link may also be interested.

@Legionaire and @hillo: Does it help?
For those using SSL this article or this one may help.
May 27, 2014 at 11:53 AM
I am regularly getting this "The request was aborted: Could not create SSL/TLS secure channel" however having read a number of posts on here that seem related I'm still unsure of the solution? As far as I can tell all certificates installed on the host server are current and up-to-date. The error does not occur for every request but it's regular enough to be a problem.
Dec 3, 2014 at 3:55 PM
Was a solution ever found for this? We are regularly getting "The request was aborted: Could not create SSL/TLS secure channel", started happening a couple weeks ago. We are running web forms on Windows Server 2008 R2 and are not using SSL to communicate with Twitter. We are using the latest version of LinqToTwitter and using AspNetAuthorizer. We had disabled SSL 3 after the Poodle exploit came out and it was working fine, but suddenly started with this error regularly.
Coordinator
Dec 3, 2014 at 7:10 PM
Hi,

I'm not sure what is causing this because I haven't encountered it myself, but I'll share some information that might help. After the Poodle exploit, Twitter disabled SSL (https://twittercommunity.com/t/twitter-no-longer-supports-sslv3/25557). I recall seeing some technical issues after that, but they seemed to have mostly been resolved. I've seen other posts, including here (https://linqtotwitter.codeplex.com/discussions/569978) where someone had a similar issue - though their final resolution doesn't sound like it's particularly related to this issue. One thing I've seen is that you can specify the protocol via ServicePointManager:
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
However, I'm not positive that makes a difference since LINQ to Twitter uses HttpClient, which has a default of TLS. Without the ability to reproduce reliably, the best advice I can think of is to add very specific exception handling for this scenario and collecting whatever information might be consistent across incidents to get a better feel of what the problem might be.

@JoeMayo
Dec 3, 2014 at 8:27 PM
I fixed this previously by forcing the ServicePointManager.SecurityProtocol as follows:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
It was working fine but in the past could of weeks the errors have returned intermittently, perhaps a couple of times a day at most and at the same time across multiple sites. Its certainly a weird one and not easily replicated because its not consistent.

SImon
Marked as answer by JoeMayo on 12/16/2014 at 5:11 PM
Dec 5, 2014 at 3:42 PM
Put in the following code and we have not experienced the error for over 24 hours now, so I am hopeful this solved it.
System.Net.ServicePointManager.Expect100Continue = true;
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls;
System.Net.ServicePointManager.MaxServicePointIdleTime = 5 * 1000; 
Thanks for your help guys!
Marked as answer by JoeMayo on 12/16/2014 at 5:11 PM