fix: disable server_name_indication suport

This commit is contained in:
DDDHuang 2022-04-08 14:31:18 +08:00
parent 4390c58ebb
commit 3e9b91e53a
3 changed files with 15 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{application, emqx_plugin_libs, {application, emqx_plugin_libs,
[{description, "EMQ X Plugin utility libs"}, [{description, "EMQ X Plugin utility libs"},
{vsn, "4.3.2"}, {vsn, "4.3.3"},
{modules, []}, {modules, []},
{applications, [kernel,stdlib]}, {applications, [kernel,stdlib]},
{env, []} {env, []}

View File

@ -2,13 +2,13 @@
{VSN, {VSN,
[ [
{<<"4\\.3\\.[0-1]">>, [ {<<"4\\.3\\.[0-2]">>, [
{load_module, emqx_plugin_libs_ssl, brutal_purge, soft_purge, []} {load_module, emqx_plugin_libs_ssl, brutal_purge, soft_purge, []}
]}, ]},
{<<".*">>, []} {<<".*">>, []}
], ],
[ [
{<<"4\\.3\\.[0-1]">>, [ {<<"4\\.3\\.[0-2]">>, [
{load_module, emqx_plugin_libs_ssl, brutal_purge, soft_purge, []} {load_module, emqx_plugin_libs_ssl, brutal_purge, soft_purge, []}
]}, ]},
{<<".*">>, []} {<<".*">>, []}

View File

@ -66,13 +66,23 @@ save_files_return_opts(Options, Dir) ->
_ -> verify_peer _ -> verify_peer
end, end,
SNI = case Get(<<"server_name_indication">>) of SNI = case Get(<<"server_name_indication">>) of
<<"disable">> -> disable;
"disable" -> disable;
"" -> undefined;
<<>> -> undefined;
undefined -> undefined; undefined -> undefined;
SNI0 -> ensure_str(SNI0) SNI0 -> ensure_str(SNI0)
end, end,
Versions = emqx_tls_lib:integral_versions(Get(<<"tls_versions">>)), Versions = emqx_tls_lib:integral_versions(Get(<<"tls_versions">>)),
Ciphers = emqx_tls_lib:integral_ciphers(Versions, Get(<<"ciphers">>)), Ciphers = emqx_tls_lib:integral_ciphers(Versions, Get(<<"ciphers">>)),
filter([{keyfile, Key}, {certfile, Cert}, {cacertfile, CA}, filter([ {keyfile, Key}
{verify, Verify}, {server_name_indication, SNI}, {versions, Versions}, {ciphers, Ciphers}]). , {certfile, Cert}
, {cacertfile, CA}
, {verify, Verify}
, {server_name_indication, SNI}
, {versions, Versions}
, {ciphers, Ciphers}
]).
%% @doc Save a key or certificate file in data dir, %% @doc Save a key or certificate file in data dir,
%% and return path of the saved file. %% and return path of the saved file.