Existing SharePoint 2016 Timer Job that captures tweets is now throwing exception

dotnet
linqtotwitter

#1

Using “LinqToTwitter”, I’ve develop a SharePoint timer job that executes on intervals and captures tweets and direct messages from specific twitter handles used by our organization principals for records retention purposes. It’s been deployed to our production environment and was working without any issues until now. Unfortunately, it is now throwing the following exception:

System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at LinqToTwitter.Net.GetMessageHandler.<SendAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at LinqToTwitter.TwitterExecute.<QueryTwitterAsync>d__48`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at LinqToTwitter.TwitterContext.<ExecuteAsync>d__121`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at LinqToTwitter.TwitterQueryProvider.<ExecuteAsync>d__8`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at LinqToTwitter.TwitterExtensions.<ToListAsync>d__2`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SPTimerJob_v1.OMBSPTimerJob.<captureUserDirectSentToMessagesFromTwitter>d__32.MoveNext()

There were no code changes and deployments since it’s been launched in production. Anyone has any ideas? Thanks.


#2

I’m not familiar with Sharepoint 2016 timer jobs and I’m only slightly familiar with LinqToTwitter. Based on the error you’ve pasted here, it looks like an SSL/TLS secure connection issue.

The last changes that were made to Twitter’s TLS configuration were a couple of years ago. I’d suggest checking that your certificate store is up-to-date, perhaps try some simple API calls using other methods to ensure you’re able to connect to api.twitter.com using your app tokens, and possibly talking to the LinqToTwitter project to see if anyone else is reporting this issue.