fix(emqx_authn_api): return file path if does not exist

This commit is contained in:
Zaiming (Stone) Shi 2022-04-05 23:02:14 +02:00
parent 1ac19b42e4
commit bc5692efd4
1 changed files with 6 additions and 2 deletions

View File

@ -1196,8 +1196,12 @@ convert_certs(#{ssl := #{enable := true} = SSLOpts} = Config) ->
undefined ->
Acc;
Filename ->
{ok, Bin} = file:read_file(Filename),
Acc#{K => Bin}
case file:read_file(Filename) of
{ok, Bin} ->
Acc#{K => Bin};
{error, _} ->
Acc#{K => Filename}
end
end
end,
SSLOpts,