So, I'm trying to download an exe from GitHub Releases page, for example PowerToys (https://github.com/microsoft/PowerToys/releases/download/v0.70.1/PowerToysSetup-0.70.1-x64.exe) when I use this link in browser, I can see that there is a redirect and file begins to download, but when I use this code in my .NET 6 project, I am getting a timeout. When trying to download for example an image, using the same code, it works.
HttpResponseMessage message = await _httpClient.GetAsync(sourceUri, cancellationToken); // there is a time out exception
message.EnsureSuccessStatusCode();
return await message.Content.ReadAsStreamAsync();
What am I doing wrong? I've tried set explicitly AllowAutoRedirect to true, MaxAutomaticRedirections, Accept header to "*/*", UserAgent, nothing works, why is it?
Thanks.
EDIT: This is the exception chain:
System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 10 seconds elapsing.
---> System.TimeoutException: A task was canceled.
---> System.Threading.Tasks.TaskCanceledException: A task was canceled..
EDIT: Tried SSL bypass, didn't work.