fix(tlsgc): consolidate conf keypaths knowledge in `emqx_tls_lib`
So that this GC mechanism will be easier to maintain.
This commit is contained in:
parent
ec06850bd0
commit
3c2a7dbadc
|
@ -240,11 +240,11 @@ find_references(Root) ->
|
||||||
Config
|
Config
|
||||||
).
|
).
|
||||||
|
|
||||||
is_file_reference([<<"keyfile">> | _]) -> true;
|
is_file_reference(Stack) ->
|
||||||
is_file_reference([<<"certfile">> | _]) -> true;
|
lists:any(
|
||||||
is_file_reference([<<"cacertfile">> | _]) -> true;
|
fun(KP) -> lists:prefix(lists:reverse(KP), Stack) end,
|
||||||
is_file_reference([<<"issuer_pem">>, <<"ocsp">> | _]) -> true;
|
emqx_tls_lib:ssl_file_conf_keypaths()
|
||||||
is_file_reference(_) -> false.
|
).
|
||||||
|
|
||||||
is_string(Value) ->
|
is_string(Value) ->
|
||||||
is_list(Value) orelse is_binary(Value).
|
is_list(Value) orelse is_binary(Value).
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
ensure_ssl_files/2,
|
ensure_ssl_files/2,
|
||||||
ensure_ssl_files/3,
|
ensure_ssl_files/3,
|
||||||
drop_invalid_certs/1,
|
drop_invalid_certs/1,
|
||||||
|
ssl_file_conf_keypaths/0,
|
||||||
pem_dir/1,
|
pem_dir/1,
|
||||||
is_managed_ssl_file/1,
|
is_managed_ssl_file/1,
|
||||||
is_valid_pem_file/1,
|
is_valid_pem_file/1,
|
||||||
|
@ -371,6 +372,10 @@ is_valid_string(Binary) when is_binary(Binary) ->
|
||||||
_Otherwise -> false
|
_Otherwise -> false
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
-spec ssl_file_conf_keypaths() -> [_ConfKeypath :: [binary()]].
|
||||||
|
ssl_file_conf_keypaths() ->
|
||||||
|
?SSL_FILE_OPT_PATHS.
|
||||||
|
|
||||||
%% Check if it is a valid PEM formatted key.
|
%% Check if it is a valid PEM formatted key.
|
||||||
is_pem(MaybePem) ->
|
is_pem(MaybePem) ->
|
||||||
try
|
try
|
||||||
|
|
Loading…
Reference in New Issue