Skip to content

Commit

Permalink
Don't check hostname. This change allows redirecting to another domain
Browse files Browse the repository at this point in the history
to download the actual package, aligning it with Hex.
  • Loading branch information
derekkraan committed Jul 3, 2023
1 parent 1b6297d commit 4d57f7a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions apps/rebar/src/rebar_utils.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1070,12 +1070,11 @@ get_cacerts() ->
Enabled :: atom(),
Url :: string() | binary(),
Res :: proplists:proplist().
ssl_opts(ssl_verify_enabled, Url) ->
ssl_opts(ssl_verify_enabled, _Url) ->
case check_ssl_version() of
true ->
#{host := Hostname} = rebar_uri:parse(rebar_utils:to_list(Url)),
VerifyFun = {fun ssl_verify_hostname:verify_fun/3,
[{check_hostname, Hostname}]},
[]},
CACerts = get_cacerts(),
SslOpts = [{verify, verify_peer}, {depth, 10}, {cacerts, CACerts},
{partial_chain, fun partial_chain/1}, {verify_fun, VerifyFun}],
Expand Down

0 comments on commit 4d57f7a

Please sign in to comment.