From 5df513f277961c4af4223dc7b9f2e2c296e2e4f7 Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Mon, 14 Nov 2022 09:57:04 -0300 Subject: [PATCH] refactor: flatten crl_cache config namespace into root --- etc/emqx.conf | 4 ++-- priv/emqx.schema | 6 +++--- test/emqx_crl_cache_SUITE.erl | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/etc/emqx.conf b/etc/emqx.conf index 2303402d3..fc7ffa3cf 100644 --- a/etc/emqx.conf +++ b/etc/emqx.conf @@ -1566,14 +1566,14 @@ listener.ssl.external.cacertfile = {{ platform_etc_dir }}/certs/cacert.pem ## ## Value: Duration ## Default: 15 s -## crl_cache.http_timeout = 15s +## crl_cache_http_timeout = 15s ## The period to refresh the CRLs from the servers. This is global ## for all URLs and listeners. ## ## Value: Duration ## Default: 15 m -## crl_cache.refresh_interval = 15m +## crl_cache_refresh_interval = 15m ## The Ephemeral Diffie-Helman key exchange is a very effective way of ## ensuring Forward Secrecy by exchanging a set of keys that never hit diff --git a/priv/emqx.schema b/priv/emqx.schema index 3fa61d490..0462b0898 100644 --- a/priv/emqx.schema +++ b/priv/emqx.schema @@ -1712,12 +1712,12 @@ end}. {datatype, string} ]}. -{mapping, "crl_cache.http_timeout", "emqx.crl_cache_http_timeout", [ +{mapping, "crl_cache_http_timeout", "emqx.crl_cache_http_timeout", [ {default, "15s"}, {datatype, {duration, ms}} ]}. -{mapping, "crl_cache.refresh_interval", "emqx.crl_cache_refresh_interval", [ +{mapping, "crl_cache_refresh_interval", "emqx.crl_cache_refresh_interval", [ {default, "15m"}, {datatype, {duration, ms}} ]}. @@ -2339,7 +2339,7 @@ end}. end, CRLCheck = case cuttlefish:conf_get(Prefix ++ ".enable_crl_check", Conf, false) of true -> - HTTPTimeout = cuttlefish:conf_get("crl_cache.http_timeout", Conf, timer:seconds(15)), + HTTPTimeout = cuttlefish:conf_get("crl_cache_http_timeout", Conf, timer:seconds(15)), %% {crl_check, true} doesn't work [ {crl_check, peer} , {crl_cache, {ssl_crl_cache, {internal, [{http, HTTPTimeout}]}}} diff --git a/test/emqx_crl_cache_SUITE.erl b/test/emqx_crl_cache_SUITE.erl index da5b0a17f..db1fc2ff2 100644 --- a/test/emqx_crl_cache_SUITE.erl +++ b/test/emqx_crl_cache_SUITE.erl @@ -124,6 +124,7 @@ end_per_testcase(t_not_cached_and_unreachable, _Config) -> end_per_testcase(t_refresh_config, Config) -> OldConfigs = ?config(old_configs, Config), meck:unload([emqx_crl_cache]), + clear_crl_cache(), emqx_ct_helpers:stop_apps([]), emqx_ct_helpers:change_emqx_opts( ssl_twoway, [ {crl_options, [ {crl_check_enabled, false} @@ -140,7 +141,6 @@ end_per_testcase(t_refresh_config, Config) -> end, OldConfigs), application:stop(cowboy), - clear_crl_cache(), ok = snabbkaffe:stop(), ok; end_per_testcase(_TestCase, _Config) ->