Przeglądaj źródła

fix(auth_pgsql): Make ssl_opts.versions backward compatible

Zaiming Shi 5 lat temu
rodzic
commit
be771f6cd9
1 zmienionych plików z 7 dodań i 1 usunięć
  1. 7 1
      apps/emqx_auth_pgsql/priv/emqx_auth_pgsql.schema

+ 7 - 1
apps/emqx_auth_pgsql/priv/emqx_auth_pgsql.schema

@@ -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