Skip to content

Download fails when redirected from HTTPS to HTTP #200

@huoshan12345

Description

@huoshan12345

Hi,

I noticed that downloads fail when the server redirects from an HTTPS URL to an HTTP URL.

This happens because HttpClient in .NET does not allow automatic redirection from HTTPS → HTTP by default, even when AllowAutoRedirect is set to true.

Steps to Reproduce

  1. Attempt to download from an HTTPS URL that responds with a 301/302 redirect to an HTTP endpoint.
  2. The download fails instead of following the redirect.

Expected Behavior

Downloader should either:

  • Handle this scenario explicitly (e.g., allow opt-in following of HTTPS → HTTP redirects), or
  • Provide a clear error message that explains why the redirect failed.

Additional Context

Relevant .NET documentation: HttpClientHandler.AllowAutoRedirect — note that HTTPS → HTTP redirects are not allowed.

Would it be possible to add an option (e.g., AllowInsecureRedirects) to support this use case for trusted servers?

Thanks!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions