mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-20 17:27:00 +01:00
Fix the error report of an incorrect certfile
This commit is contained in:
parent
c9efdf6167
commit
b50a4948ed
@ -410,20 +410,22 @@ process_term(Term, State) ->
|
||||
{s2s_use_starttls, Port} ->
|
||||
add_option(s2s_use_starttls, Port, State);
|
||||
{s2s_certfile, CertFile} ->
|
||||
case ejabberd_config:is_file_readable(CertFile) of
|
||||
CertFileS = binary_to_list(CertFile),
|
||||
case ejabberd_config:is_file_readable(CertFileS) of
|
||||
true -> add_option(s2s_certfile, CertFile, State);
|
||||
false ->
|
||||
ErrorText = "There is a problem in the configuration: "
|
||||
"the specified file is not readable: ",
|
||||
throw({error, ErrorText ++ CertFile})
|
||||
throw({error, ErrorText ++ CertFileS})
|
||||
end;
|
||||
{domain_certfile, Domain, CertFile} ->
|
||||
case ejabberd_config:is_file_readable(CertFile) of
|
||||
CertFileS = binary_to_list(CertFile),
|
||||
case ejabberd_config:is_file_readable(CertFileS) of
|
||||
true -> add_option({domain_certfile, Domain}, CertFile, State);
|
||||
false ->
|
||||
ErrorText = "There is a problem in the configuration: "
|
||||
"the specified file is not readable: ",
|
||||
throw({error, ErrorText ++ CertFile})
|
||||
throw({error, ErrorText ++ CertFileS})
|
||||
end;
|
||||
{node_type, NodeType} ->
|
||||
add_option(node_type, NodeType, State);
|
||||
|
@ -491,9 +491,10 @@ certfile_readable(Opts) ->
|
||||
case proplists:lookup(certfile, Opts) of
|
||||
none -> true;
|
||||
{certfile, Path} ->
|
||||
case ejabberd_config:is_file_readable(Path) of
|
||||
PathS = binary_to_list(Path),
|
||||
case ejabberd_config:is_file_readable(PathS) of
|
||||
true -> true;
|
||||
false -> {false, Path}
|
||||
false -> {false, PathS}
|
||||
end
|
||||
end.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user