diff --git a/mix.exs b/mix.exs index 39571808f..d519b9992 100644 --- a/mix.exs +++ b/mix.exs @@ -77,7 +77,6 @@ defmodule Ejabberd.MixProject do result = [{:d, :ELIXIR_ENABLED}] ++ cond_options() ++ Enum.map(includes, fn (path) -> {:i, path} end) ++ - if_version_below(~c"21", [{:d, :NO_CUSTOMIZE_HOSTNAME_CHECK}]) ++ if_version_below(~c"23", [{:d, :USE_OLD_CRYPTO_HMAC}]) ++ if_version_below(~c"23", [{:d, :USE_OLD_PG2}]) ++ if_version_below(~c"24", [{:d, :COMPILER_REPORTS_ONLY_LINES}]) ++ diff --git a/rebar.config b/rebar.config index eb67dc485..83b053ae4 100644 --- a/rebar.config +++ b/rebar.config @@ -112,7 +112,6 @@ {erl_opts, [nowarn_deprecated_function, {i, "include"}, - {if_version_below, "21", {d, 'NO_CUSTOMIZE_HOSTNAME_CHECK'}}, {if_version_below, "23", {d, 'USE_OLD_CRYPTO_HMAC'}}, {if_version_below, "23", {d, 'USE_OLD_PG2'}}, {if_version_below, "24", {d, 'COMPILER_REPORTS_ONLY_LINES'}}, diff --git a/src/eldap.erl b/src/eldap.erl index 3676bd09a..437ac6bc2 100644 --- a/src/eldap.erl +++ b/src/eldap.erl @@ -1036,20 +1036,12 @@ polish([H | T], Res, polish(T, Res, [H | Ref]); polish([], Res, Ref) -> {Res, Ref}. - --ifdef(NO_CUSTOMIZE_HOSTNAME_CHECK). -check_hostname_opt(TLSOpts) -> - TLSOpts. --else. -check_hostname_opt(TLSOpts) -> - MatchFun = public_key:pkix_verify_hostname_match_fun(https), - [{customize_hostname_check, [{match_fun, MatchFun}]} | TLSOpts]. --endif. - host_tls_options(Host, TLSOpts) -> case proplists:get_value(verify, TLSOpts) of verify_peer -> - check_hostname_opt([{server_name_indication, Host} | TLSOpts]); + TLSOpts2 = [{server_name_indication, Host} | TLSOpts], + MatchFun = public_key:pkix_verify_hostname_match_fun(https), + [{customize_hostname_check, [{match_fun, MatchFun}]} | TLSOpts2]; _ -> TLSOpts end.