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 -> undefined ->
Acc; Acc;
Filename -> Filename ->
{ok, Bin} = file:read_file(Filename), case file:read_file(Filename) of
Acc#{K => Bin} {ok, Bin} ->
Acc#{K => Bin};
{error, _} ->
Acc#{K => Filename}
end
end end
end, end,
SSLOpts, SSLOpts,