jellyfin / TMDbLib

C#.Net library for TheMovieDB
MIT License
344 stars 128 forks source link

The SSL connection could not be established #423

Closed raggabrashtrout closed 1 year ago

raggabrashtrout commented 1 year ago

I have a couple of WinForms applications both have been working fine until recently Movies app is working fine without error using the same API Key

Fetching info about TV shows due to this error I ported the code into a new VS 2022 Winform using TMDbLib V 1.9.2 This is happening on a local Win10 PC and in MS azure VM Is this me, yourselves or changes to the API?

If it's me how do I fix it?

I'm getting the following errors

    // Access to The Movie DB API
    TMDbClient client = new TMDbClient(<API KEY>);

Error: but no exception

'client.Config' threw an exception of type 'System.InvalidOperationException' Then var NewEpisode = client.GetTvEpisodeAsync(TMDBid, SeasonNumber, Epnum).Result; or SearchContainer<SearchTv> results = client.SearchTvShowAsync(ShowName).Result;

Gives

InnerException  {"The SSL connection could not be established, see inner exception."}   System.Exception {System.Net.Http.HttpRequestException}

{"Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.."}

        StackTrace  "   at System.Net.Http.ConnectHelper.<EstablishSslConnectionAsync>d__2.MoveNext()\r\n   
        at System.Threading.Tasks.ValueTask`1.get_Result()\r\n   
        at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult()\r\n   
        at System.Net.Http.HttpConnectionPool.<ConnectAsync>d__96.MoveNext()\r\n   
        at System.Threading.Tasks.ValueTask`1.get_Result()\r\n   
        at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult()\r\n   
        at System.Net.Http.HttpConnectionPool.<CreateHttp11ConnectionAsync>d__98.MoveNext()\r\n   
        at System.Threading.Tasks.ValueTask`1.get_Result()\r\n   
        at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult()\r\n   
        at System.Net.Http.HttpConnectionPool.<AddHttp11ConnectionAsync>d__73.MoveNext()\r\n   
        at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.<WaitWithCancellationAsync>d__1.MoveNext()\r\n   
at System.Threading.Tasks.ValueTask`1.get_Result()\r\n   
at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult()\r\n   
at System.Net.Http.HttpConnectionPool.<GetHttp11ConnectionAsync>d__75.MoveNext()\r\n   
at System.Threading.Tasks.ValueTask`1.get_Result()\r\n   
at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult()\r\n   
at System.Net.Http.HttpConnectionPool.<SendWithVersionDetectionAndRetryAsync>d__83.MoveNext()\r\n   
at System.Threading.Tasks.ValueTask`1.get_Result()\r\n   
at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult()\r\n   
at System.Net.Http.RedirectHandler.<SendAsync>d__4.MoveNext()\r\n   
at System.Net.Http.HttpClient.<<SendAsync>g__Core|83_0>d.MoveNext()\r\n   
at TMDbLib.Rest.RestRequest.<SendInternal>d__19.MoveNext()\r\n   
at TMDbLib.Rest.RestRequest.<Get>d__15`1.MoveNext()\r\n   
at TMDbLib.Rest.RestRequestExtensions.<GetOfT>d__1`1.MoveNext()\r\n   
at TMDbLib.Client.TMDbClient.<SearchMethodInternal>d__183`1.MoveNext()\r\n   
at TMDbLib.Client.TMDbClient.<SearchTvShowAsync>d__196.MoveNext()\r\n   
at TMDbLib.Client.TMDbClient.<SearchTvShowAsync>d__195.MoveNext()"  string
LordMike commented 1 year ago

This error is a connectivity issue w/ TMDbLib. Especially the An existing connection was forcibly closed by the remote host part.