fix(auth_pgsql): Make ssl_opts.versions backward compatible

This commit is contained in:
Zaiming Shi 2021-01-18 19:59:42 +01:00
parent 14ca914068
commit be771f6cd9
1 changed files with 7 additions and 1 deletions

View File

@ -67,6 +67,12 @@
{datatype, string}
]}.
%% FIXME: compatible with 4.0-4.2 version format, plan to delete in 5.0
{mapping, "auth.pgsql.ssl_opts.tls_versions", "emqx_auth_pgsql.server", [
{default, "tlsv1.2"},
{datatype, string}
]}.
{translation, "emqx_auth_pgsql.server", fun(Conf) ->
{PgHost, PgPort} =
case cuttlefish:conf_get("auth.pgsql.server", Conf) of
@ -88,7 +94,7 @@
{certfile, cuttlefish:conf_get(Prefix ++ ".certfile", Conf, undefined)},
{cacertfile, cuttlefish:conf_get(Prefix ++ ".cacertfile", Conf, undefined),
{versions, [list_to_existing_atom(Value)
||Value <- string:tokens(cuttlefish:conf_get("auth.pgsql.ssl.tls_versions", Conf), " ,")]}}])
||Value <- string:tokens(cuttlefish:conf_get(Prefix ++ ".tls_versions", Conf), " ,")]}}])
end,
%% FIXME: compatible with 4.0-4.2 version format, plan to delete in 5.0