Skip to content

Commit

Permalink
Merge pull request #2896 from ariel-anieli/remove-hostname-checks
Browse files Browse the repository at this point in the history
Remove hostname checks
  • Loading branch information
ferd authored Jun 10, 2024
2 parents 8dc4049 + c5f81da commit cea518c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
3 changes: 1 addition & 2 deletions apps/rebar/rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
{overrides, [{add, relx, [{erl_opts, [{d, 'RLX_LOG', rebar_log}]}]}]}.

{erl_opts, [warnings_as_errors,
{platform_define, "^(2[1-9])|(20\\\\.3)", filelib_find_source},
{platform_define, "^(1|(20))", no_customize_hostname_check}
{platform_define, "^(2[1-9])|(20\\\\.3)", filelib_find_source}
]}.

{edoc_opts, [preprocess]}.
Expand Down
8 changes: 0 additions & 8 deletions apps/rebar/src/rebar_utils.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1138,17 +1138,9 @@ ssl_opts(ssl_verify_enabled, Url) ->
[{verify, verify_none}]
end.

-ifdef(no_customize_hostname_check).
check_hostname_opt(Url, Opts) ->
#{host := Hostname} = rebar_uri:parse(rebar_utils:to_list(Url)),
VerifyFun = {fun ssl_verify_hostname:verify_fun/3,
[{check_hostname, Hostname}]},
[{verify_fun, VerifyFun} | Opts].
-else.
check_hostname_opt(_, Opts) ->
MatchFun = public_key:pkix_verify_hostname_match_fun(https),
[{customize_hostname_check, [{match_fun, MatchFun}]} | Opts].
-endif.

-spec partial_chain(Certs) -> Res when
Certs :: list(any()),
Expand Down

0 comments on commit cea518c

Please sign in to comment.