]> granicus.if.org Git - ejabberd/commitdiff
Only validate certfiles if public_key:short_name_hash/1 is available
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Fri, 12 May 2017 14:51:17 +0000 (17:51 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Fri, 12 May 2017 14:51:17 +0000 (17:51 +0300)
src/ejabberd_pkix.erl

index ffdc0cea49e307abb116f77caa7aa899a5fcb95c..f99a2c12ec732fab0c247740bf35256f6994255f 100644 (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