Skip to content

Replace Hackney with Req as HTTP client#165

Open
ry4n1m3 wants to merge 1 commit into
lau:masterfrom
mechanical-orchard:replace-hackney-with-req
Open

Replace Hackney with Req as HTTP client#165
ry4n1m3 wants to merge 1 commit into
lau:masterfrom
mechanical-orchard:replace-hackney-with-req

Conversation

@ry4n1m3

@ry4n1m3 ry4n1m3 commented Feb 11, 2026

Copy link
Copy Markdown

Addresses security concerns with Hackney (CVE-2018-1000007, AIKIDO-2026-10122). Req provides a modern, actively maintained HTTP client built on Mint.

Changes:

  • Add Req as required dependency, remove Hackney
  • Implement Tzdata.HTTPClient.Req with redirect support
  • Set Req as default HTTP client in configuration
  • Hackney implementation remains available for backward compatibility
  • Update README with migration information

Licensing: This contribution is made by employees of Mechanical Orchard, Inc. under the terms of the project's license.

Addresses security concerns with Hackney (CVE-2018-1000007,
AIKIDO-2026-10122). Req provides a modern, actively maintained
HTTP client built on Mint.

Changes:
- Add Req as required dependency, remove Hackney
- Implement Tzdata.HTTPClient.Req with redirect support
- Set Req as default HTTP client in configuration
- Hackney implementation remains available for backward compatibility
- Update README with migration information

Co-Authored-By: Matt Wynne <matt.wynne@mechanical-orchard.com>
@cdhagmann

Copy link
Copy Markdown

This would be great!

@mhsdef

mhsdef commented May 4, 2026

Copy link
Copy Markdown

Plus one. @lau, any chance this could get merged and released?

metabren added a commit to Finger-Ink/notifiex that referenced this pull request May 13, 2026
Internal HTTP/JSON client swap. Public API unchanged. Motivated by
Hackney's security history; mirrors lau/tzdata#165.

Also bumps Elixir floor to 1.15, modernises ex_doc/credo/dialyxir, and
moves CI to OTP 26 / Elixir 1.17. Adds Bypass-backed tests for the
Slack and Discord services (0% → 85%/100% on those modules).

Caller-visible breaking change: transport-error reasons are now strings
("connection refused") rather than atoms (:econnrefused). Tuple shape
{:error, {:error, reason}} is unchanged. See CHANGELOG.md and
guides/upgrading_to_v2.md.
@nirev

nirev commented May 26, 2026

Copy link
Copy Markdown

With the recent CVEs and hackney 4.x.x released, can we get this one merged?

acrogenesis added a commit to valiot/tzdata that referenced this pull request Jun 9, 2026
…ff by default

Follow-up to the Hackney→Req switch (PR lau#165):

- The Req HTTP client now issues requests through the `Tzdata.Finch` pool that
  `Tzdata.App` already starts. As applied, the supervised pool was started but
  unused (Req fell back to its own default Finch), leaving a dead process; both
  get/3 and head/3 now pass `finch: Tzdata.Finch`.
- Exclude `:integration` (live IANA) and `:req` (httpbin) tags by default in
  test_helper so the suite is deterministic/offline; tag the Finch pool test
  `:integration` since it makes a live request. Run them with
  `mix test --include integration --include req`.

Verified on Elixir 1.20.1/OTP 29: req ~> 0.5 resolves to 0.6.1, no hackney in
the tree, and the full update path (ensure_all_started(:tzdata) +
ReleaseUpdater.poll_for_update) downloads the live IANA release (2026b) and
builds periods with no FunctionClauseError.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants