SSL errors connecting to TMDB

38 views
Skip to first unread message

Usman Iqbal

unread,
Apr 28, 2024, 1:58:57 PMApr 28
to TV Rename
Hello,

Im unable currently to talk to either the TVDB or TMDB APIs.  They both give the same error, which makes me think its something wrong with my machine.

Ive attached the error I get in the logs when searching for "Tenet" against TMDB.  The interesting thing is that, if I go to TMDB in my browser (Brave and Edge) it connects fine and there isn't any SSL connections errors.  I would have assumed TVRename would use the same settings but can't work it out!

(Some searching says it may be mismatched SSL ciphers, but from the above this seems unlikely).  Any thoughts greatly appreciated!

- - - - -

2024-04-28 18:53:26|INFO| Adding New Movie
2024-04-28 18:53:26|INFO| TV Rename is about to be busy doing Add Movie since 28/04/2024 18:53:26
2024-04-28 18:53:30|WARN| Error Error searching on TMDB:: HttpRequestException obtained. [1 - 28/04 18:53:30.602639] Exception: MoveNext: The SSL connection could not be established, see inner exception. from System.Net.Http
: EstablishSslConnectionAsync.MoveNext, Ln 0 Col 0
: System.Runtime.ExceptionServices.ExceptionDispatchInfo.MoveNext, Ln 0 Col 0
: System.Runtime.CompilerServices.TaskAwaiter.MoveNext, Ln 0 Col 0
 from Void MoveNext(). Further details: [1 - 28/04 18:53:30.618806] Exception: MoveNext: Authentication failed, see inner exception. from System.Net.Security
: ForceAuthenticationAsync.MoveNext, Ln 0 Col 0
: System.Runtime.ExceptionServices.ExceptionDispatchInfo.MoveNext, Ln 0 Col 0
: System.Runtime.CompilerServices.TaskAwaiter.MoveNext, Ln 0 Col 0
 
2024-04-28 18:53:30|WARN| TVRename.SourceConnectivityException: Error searching on TMDB: TVRename.SourceConnectivityException: Error searching on TMDB:
 ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
 ---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception.
 ---> System.ComponentModel.Win32Exception (0x80090308): The token supplied to the function is invalid
   --- End of inner exception stack trace ---
   at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)
   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage request)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at TMDbLib.Rest.RestRequest.SendInternal(HttpMethod method, CancellationToken cancellationToken)
   at TMDbLib.Rest.RestRequest.Get[T](CancellationToken cancellationToken)
   at TMDbLib.Rest.RestRequestExtensions.GetOfT[T](RestRequest request, CancellationToken cancellationToken)
   at TMDbLib.Client.TMDbClient.SearchMethodInternal[T](String method, String query, Int32 page, String language, Nullable`1 includeAdult, Int32 year, String dateFormat, String region, Int32 primaryReleaseYear, Int32 firstAirDateYear, CancellationToken cancellationToken)
   at TMDbLib.Client.TMDbClient.SearchMovieAsync(String query, String language, Int32 page, Boolean includeAdult, Int32 year, String region, Int32 primaryReleaseYear, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at TVRename.TMDB.LocalCache.HandleWebErrorsFor[T](Func`1 webCall, String errorMessage)
   at TVRename.TMDB.LocalCache.Search(String text, Boolean showErrorMsgBox, MediaType type, Locale locale)
   at TVRename.CodeFinder.Search(Boolean showErrorMsgBox)

Tom Snyder

unread,
Apr 28, 2024, 6:31:54 PMApr 28
to TV Rename
Are you running Windows 7 or 8?

Usman Iqbal

unread,
Apr 28, 2024, 7:17:04 PMApr 28
to TV Rename
I'm running Windows 11 :-)

Usman Iqbal

unread,
Apr 29, 2024, 12:36:38 PMApr 29
to TV Rename
I think Ive worked it out - it appears to be an issue with Windows 11 and \ or TMDB.
Windows 10 doesn't support TLS 1.3 but Windows 11 does.  When Win11 communicates via TLS 1.3, TMDB isn't happy and falls over.  If I disable TLS 1.3 via the registry (following this: https://github.com/dotnet/runtime/issues/77393#issuecomment-1290468361) it all works fine; assumedly using TLS 1.2

This doesn't really explain what exactly is happening (is it a bug in Windows?  Is it an issue with TMDBs TLS 1.3 support?), but Im convinced it isn't TVRename itself causing an issue.  Im going to do further research from that angle and will update if I find anything interesting

Thanks for the help Tom :-D

Tom Snyder

unread,
Apr 29, 2024, 2:28:06 PMApr 29
to TV Rename
The problems we always saw before was with Windows 7 because you had to jump through hoops to get it to use TLS 1.2.  Even then, it was just a subset of 1.2 it could use.  That's why I immediately thought Windows 7 (and the not as often used 8/8.1).  I've found that, for the most part, you're probably best just setting it TLS 1.2 and forget it.  The only time I was able to use 1.3 directly without any problem is with one of my Synology NASes.  That is also true for websites.  TLS 1.3 will have its day but for now it is best to stick with 1.2.
Reply all
Reply to author
Forward
0 new messages