Only validate certfiles if public_key:short_name_hash/1 is available

This commit is contained in:
Evgeniy Khramtsov 2017-05-12 17:51:17 +03:00
parent cc58ce6301
commit 2d17a2850c
1 changed files with 4 additions and 1 deletions

View File

@ -152,7 +152,10 @@ init([]) ->
ejabberd_hooks:add(route_registered, ?MODULE, route_registered, 50),
Validate = case os:type() of
{win32, _} -> false;
_ -> true
_ ->
code:ensure_loaded(public_key),
erlang:function_exported(
public_key, short_name_hash, 1)
end,
if Validate -> check_ca_dir();
true -> ok