Jackett icon indicating copy to clipboard operation
Jackett copied to clipboard

[montorrent] The message received was unexpected or badly formatted. (Test)

Open Dark-Yox opened this issue 5 years ago • 4 comments

Environment

OS: Windows 10 (64-bit) 20H2

.Net Runtime: .Net-Framework

.Net Version: 4.8

Jackett Version: 0.17.562

Are you using a proxy or VPN? no

Description

Test the tracker or try to search for something.

Logged Error Messages

Jackett.Common.IndexerException: Exception (montorrent): The message received was unexpected or badly formatted.
 ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
 ---> System.Security.Authentication.AuthenticationException: Authentication failed because the remote party sent a TLS alert: 'ProtocolVersion'.
 ---> System.ComponentModel.Win32Exception (0x80090326): The message received was unexpected or badly formatted.
   --- 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.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, 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.GetHttpConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at FlareSolverrSharp.ClearanceHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken)
   at Jackett.Common.Utils.Clients.HttpWebClient2.Run(WebRequest webRequest) in D:\a\1\s\src\Jackett.Common\Utils\Clients\HttpWebClient2.cs:line 170
   at Jackett.Common.Utils.Clients.WebClient.GetResultAsync(WebRequest request) in D:\a\1\s\src\Jackett.Common\Utils\Clients\WebClient.cs:line 207
   at Jackett.Common.Indexers.BaseWebIndexer.RequestWithCookiesAsync(String url, String cookieOverride, RequestType method, String referer, IEnumerable`1 data, Dictionary`2 headers, String rawbody, Nullable`1 emulateBrowser) in D:\a\1\s\src\Jackett.Common\Indexers\BaseIndexer.cs:line 496
   at Jackett.Common.Indexers.CardigannIndexer.PerformQuery(TorznabQuery query) in D:\a\1\s\src\Jackett.Common\Indexers\CardigannIndexer.cs:line 1271
   at Jackett.Common.Indexers.BaseIndexer.ResultsForQuery(TorznabQuery query, Boolean isMetaIndexer) in D:\a\1\s\src\Jackett.Common\Indexers\BaseIndexer.cs:line 390
   --- End of inner exception stack trace ---
   at Jackett.Common.Indexers.BaseIndexer.ResultsForQuery(TorznabQuery query, Boolean isMetaIndexer) in D:\a\1\s\src\Jackett.Common\Indexers\BaseIndexer.cs:line 390
   at Jackett.Common.Indexers.BaseWebIndexer.ResultsForQuery(TorznabQuery query, Boolean isMetaIndexer) in D:\a\1\s\src\Jackett.Common\Indexers\BaseIndexer.cs:line 659
   at Jackett.Common.Services.IndexerManagerService.TestIndexer(String name) in D:\a\1\s\src\Jackett.Common\Services\IndexerManagerService.cs:line 306
   at Jackett.Server.Controllers.IndexerApiController.Test() in D:\a\1\s\src\Jackett.Server\Controllers\IndexerApiController.cs:line 132
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Jackett.Server.Middleware.CustomExceptionHandler.Invoke(HttpContext httpContext) in D:\a\1\s\src\Jackett.Server\Middleware\CustomExceptionHandler.cs:line 61

Dark-Yox avatar Feb 19 '21 08:02 Dark-Yox

confirmed. I see this too. Jackett sends https://www.montorrent.com/torrents/?langue=on&order=id&orderby=desc which works on the chrome browser but my Windows 10 (64-bit) 20H2 Jackett 0.17.562 enhanced log returns :

Jackett.Common.IndexerException: Exception (montorrent): The message received was unexpected or badly formatted.
 ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
 ---> System.Security.Authentication.AuthenticationException: Authentication failed because the remote party sent a TLS alert: 'ProtocolVersion'.
 ---> System.ComponentModel.Win32Exception (0x80090326): The message received was unexpected or badly formatted.
   --- 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.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, 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.GetHttpConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at FlareSolverrSharp.ClearanceHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken)
   at Jackett.Common.Utils.Clients.HttpWebClient2.Run(WebRequest webRequest) in D:\a\1\s\src\Jackett.Common\Utils\Clients\HttpWebClient2.cs:line 170
   at Jackett.Common.Utils.Clients.WebClient.GetResultAsync(WebRequest request) in D:\a\1\s\src\Jackett.Common\Utils\Clients\WebClient.cs:line 184
   at Jackett.Common.Indexers.BaseWebIndexer.RequestWithCookiesAsync(String url, String cookieOverride, RequestType method, String referer, IEnumerable`1 data, Dictionary`2 headers, String rawbody, Nullable`1 emulateBrowser) in D:\a\1\s\src\Jackett.Common\Indexers\BaseIndexer.cs:line 492
   at Jackett.Common.Indexers.CardigannIndexer.PerformQuery(TorznabQuery query) in D:\a\1\s\src\Jackett.Common\Indexers\CardigannIndexer.cs:line 1271
   at Jackett.Common.Indexers.BaseIndexer.ResultsForQuery(TorznabQuery query, Boolean isMetaIndexer) in D:\a\1\s\src\Jackett.Common\Indexers\BaseIndexer.cs:line 380
   --- End of inner exception stack trace ---
   at Jackett.Common.Indexers.BaseIndexer.ResultsForQuery(TorznabQuery query, Boolean isMetaIndexer) in D:\a\1\s\src\Jackett.Common\Indexers\BaseIndexer.cs:line 388
   at Jackett.Common.Indexers.BaseWebIndexer.ResultsForQuery(TorznabQuery query, Boolean isMetaIndexer) in D:\a\1\s\src\Jackett.Common\Indexers\BaseIndexer.cs:line 656
   at Jackett.Common.Services.IndexerManagerService.TestIndexer(String name) in D:\a\1\s\src\Jackett.Common\Services\IndexerManagerService.cs:line 306
   at Jackett.Server.Controllers.IndexerApiController.Test() in D:\a\1\s\src\Jackett.Server\Controllers\IndexerApiController.cs:line 132
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Jackett.Server.Middleware.CustomExceptionHandler.Invoke(HttpContext httpContext) in D:\a\1\s\src\Jackett.Server\Middleware\CustomExceptionHandler.cs:line 61

no idea why.

garfield69 avatar Feb 19 '21 08:02 garfield69

Site only supports TLS 1.3 - https://www.ssllabs.com/ssltest/analyze.html?d=www.montorrent.com&s=104.21.30.125 - not sure if that could be the cause.

ilike2burnthing avatar Feb 19 '21 10:02 ilike2burnthing

Site only supports TLS 1.3

Yes, that makes sense. The inner exception is for protocolVersion, which is TLS speak for "we know about the protocol version you want to try using, but it is not supported"

What I do not understand is why Jackett's https session attempt would settle for 1.1 or 1.2 instead of 1.3 or why the negotiation between client and host would not happily chat about which version is acceptable and settle on using 1.3 The chrome browser can manage a https session with this web site, so why not the https request from Jackett? Too technical for me, require help from a security expert.

garfield69 avatar Mar 08 '21 03:03 garfield69

I also don't understand why the certificates: statement I added in the yaml to ignore CA with thumbprint 9c74ee6ca4886141985ba682551f2e42f9bdf56e does not let me ignore the CA like Jackett can for other CA with expired dates or invalid domains. I guess the TLS 1.3 protocolVersion error occurs too early in the CA validation process for the ignore-this-CA code to take effect? Annoying!

garfield69 avatar Aug 21 '21 09:08 garfield69

indexer removed. 762e9991098022d6fe9d1dbe0090a48e25b0f9f4

mynameisbogdan avatar Apr 26 '23 14:04 mynameisbogdan