Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# NEWS

1.25.0 - 2025-07-24
-------------------

** IMPORTANT CHANGE **

- change: `insecure_basic_auth` now defaults to `true` instead of `false`

This restores backward compatibility with pre-1.24.0 behavior where basic auth
was allowed over HTTP connections. If you need strict HTTPS-only basic auth:
- Set globally: `application:set_env(hackney, insecure_basic_auth, false)`
- Or per-request: `{insecure_basic_auth, false}` in options

1.24.1 - 2025-05-26
-------------------

Expand All @@ -18,12 +30,6 @@
- fix: controlling_process error handling in happy eyeballs and connection pool return
- improvement: update GitHub Actions to ubuntu-22.04 and bump certifi/mimerl dependencies

** Breaking Change **

The new `insecure_basic_auth` application variable defaults to `false` for security.
If your application relies on insecure basic auth over HTTP, you must explicitly set
`application:set_env(hackney, insecure_basic_auth, true)` to maintain previous behavior.

1.23.0 - 2025-02-25
-------------------

Expand Down
2 changes: 1 addition & 1 deletion src/hackney.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{application, hackney,
[
{description, "simple HTTP client"},
{vsn, "1.24.1"},
{vsn, "1.25.0"},
{registered, [hackney_pool]},
{applications, [kernel,
stdlib,
Expand Down
4 changes: 2 additions & 2 deletions src/hackney.erl
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ request(Method, URL, Headers, Body) ->
%% redirection even on POST</li>
%% <li>`{basic_auth, {binary, binary}}`: HTTP basic auth username and password.
%% Only allowed over HTTPS unless {insecure_basic_auth, true} is also set.</li>
%% <li>`{insecure_basic_auth, boolean}': false by default. When true, allows
%% <li>`{insecure_basic_auth, boolean}': true by default. When true, allows
%% basic auth over unencrypted HTTP connections (security risk).
%% Can also be set globally via application:set_env(hackney, insecure_basic_auth, true).</li>
%% Can also be set globally via application:set_env(hackney, insecure_basic_auth, false).</li>
%% <li>`{proxy, proxy_options()}': to connect via a proxy.</li>
%% <li>`insecure': to perform "insecure" SSL connections and
%% transfers without checking the certificate</li>
Expand Down
2 changes: 1 addition & 1 deletion src/hackney_request.erl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ perform(Client0, {Method0, Path0, Headers0, Body0}) ->
maybe_add_cookies(Cookies, [{<<"User-Agent">>, default_ua()}]);
{User, Pwd} ->
%% Security: Check if basic auth over HTTP is allowed
AllowInsecureAuth = proplists:get_value(insecure_basic_auth, Options, hackney_app:get_app_env(insecure_basic_auth, false)),
AllowInsecureAuth = proplists:get_value(insecure_basic_auth, Options, hackney_app:get_app_env(insecure_basic_auth, true)),
case {Client0#client.transport, AllowInsecureAuth} of
{hackney_ssl, _} ->
%% HTTPS connection - always safe
Expand Down
Loading