linvi / tweetinvi

Tweetinvi, an intuitive Twitter C# library for the REST and Stream API. It supports .NET, .NETCore, UAP (Xamarin)...
MIT License
1.01k stars 220 forks source link

TrustFailure at client creation #1203

Open clc-chris opened 1 year ago

clc-chris commented 1 year ago

Hello,

I am trying the following code with my credentials. The code runs in Rider 2022.2.3. The credentials work in PostMan. THe app is using Mono.

var userCredentials = new TwitterCredentials("CONSUMER_KEY", "CONSUMER_SECRET", "ACCESS_TOKEN", "ACCESS_TOKEN_SECRET");
var userClient = new TwitterClient(appCredentials);

var homeTimelineTweets = await userClient.Timelines.GetHomeTimelineAsync();

I get the following result: _Unhandled Exception: Reason : Error: TrustFailure (Authentication failed, see inner exception.) Code : -1 Date : 7/01/2023 12:03:10 AM +11:00 URL : https://api.twitter.com/1.1/statuses/home_timeline.json?count=200&tweet_mo de=extended&exclude_replies=false Twitter documentation description :

Unhandled Exception: Reason : Error: TrustFailure (Authentication failed, see inner exception.) Code : -1 Date : 7/01/2023 12:03:10 AM +11:00 URL : https://api.twitter.com/1.1/statuses/home_timeline.json?count=200&tweet_mo de=extended&exclude_replies=false Twitter documentation description :

System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host. at Mono.Debugger.Soft.TcpConnection.TransportReceive(Byte[] buf, Int32 buf_offset, Int32 len) at Mono.Debugger.Soft.Connection.ReadPacket() at Mono.Debugger.Soft.Connection.ReceivePacket() at Mono.Debugger.Soft.Connection.receiver_thread_main() Process "C:/Apps/Godot_v3.4.4-stable_mono_win64/Godot_v3.4.4-stable_monowin64.exe --path "C:/Dev/marketingfriend"" terminated with exit code 1.

clc-chris commented 1 year ago

So this was for Godot. I ended up using the beta of godot (4) and it worked as expected. Will leave the issue open in case it is relevant to others