fix(authz api): fix error for read cert file
This commit is contained in:
parent
c90342da4a
commit
585c4892ce
|
@ -428,22 +428,22 @@ update_config(Cmd, Sources) ->
|
|||
end.
|
||||
|
||||
read_cert(#{<<"ssl">> := #{<<"enable">> := true} = SSL} = Source) ->
|
||||
CaCert = case file:read_file(maps:get(cacertfile, SSL, "")) of
|
||||
CaCert = case file:read_file(maps:get(<<"cacertfile">>, SSL, "")) of
|
||||
{ok, CaCert0} -> CaCert0;
|
||||
_ -> ""
|
||||
end,
|
||||
Cert = case file:read_file(maps:get(certfile, SSL, "")) of
|
||||
Cert = case file:read_file(maps:get(<<"certfile">>, SSL, "")) of
|
||||
{ok, Cert0} -> Cert0;
|
||||
_ -> ""
|
||||
end,
|
||||
Key = case file:read_file(maps:get(keyfile, SSL, "")) of
|
||||
Key = case file:read_file(maps:get(<<"keyfile">>, SSL, "")) of
|
||||
{ok, Key0} -> Key0;
|
||||
_ -> ""
|
||||
end,
|
||||
Source#{ssl => SSL#{cacertfile => CaCert,
|
||||
certfile => Cert,
|
||||
keyfile => Key
|
||||
}
|
||||
Source#{<<"ssl">> => SSL#{<<"cacertfile">> => CaCert,
|
||||
<<"certfile">> => Cert,
|
||||
<<"keyfile">> => Key
|
||||
}
|
||||
};
|
||||
read_cert(Source) -> Source.
|
||||
|
||||
|
|
Loading…
Reference in New Issue