Merge pull request #5696 from tigercl/fix/sni
fix(sni): fix bad type of sni
This commit is contained in:
commit
4664b85968
|
@ -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.0"},
|
{vsn, "4.3.1"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{applications, [kernel,stdlib]},
|
{applications, [kernel,stdlib]},
|
||||||
{env, []}
|
{env, []}
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
%% -*-: erlang -*-
|
||||||
|
|
||||||
|
{VSN,
|
||||||
|
[
|
||||||
|
{<<"4.3.0">>, [
|
||||||
|
{load_module, emqx_plugin_libs_ssl, brutal_purge, soft_purge, []}
|
||||||
|
]},
|
||||||
|
{<<".*">>, []}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{<<"4.3.0">>, [
|
||||||
|
{load_module, emqx_plugin_libs_ssl, brutal_purge, soft_purge, []}
|
||||||
|
]},
|
||||||
|
{<<".*">>, []}
|
||||||
|
]
|
||||||
|
}.
|
|
@ -65,7 +65,10 @@ save_files_return_opts(Options, Dir) ->
|
||||||
false -> verify_none;
|
false -> verify_none;
|
||||||
_ -> verify_peer
|
_ -> verify_peer
|
||||||
end,
|
end,
|
||||||
SNI = Get(<<"server_name_indication">>),
|
SNI = case Get(<<"server_name_indication">>) of
|
||||||
|
undefined -> undefined;
|
||||||
|
SNI0 -> ensure_str(SNI0)
|
||||||
|
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}, {certfile, Cert}, {cacertfile, CA},
|
||||||
|
@ -81,6 +84,7 @@ save_file(Param, SubDir) ->
|
||||||
|
|
||||||
filter([]) -> [];
|
filter([]) -> [];
|
||||||
filter([{_, ""} | T]) -> filter(T);
|
filter([{_, ""} | T]) -> filter(T);
|
||||||
|
filter([{_, undefined} | T]) -> filter(T);
|
||||||
filter([H | T]) -> [H | filter(T)].
|
filter([H | T]) -> [H | filter(T)].
|
||||||
|
|
||||||
do_save_file(#{<<"filename">> := FileName, <<"file">> := Content}, Dir)
|
do_save_file(#{<<"filename">> := FileName, <<"file">> := Content}, Dir)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{application, emqx_web_hook,
|
{application, emqx_web_hook,
|
||||||
[{description, "EMQ X WebHook Plugin"},
|
[{description, "EMQ X WebHook Plugin"},
|
||||||
{vsn, "4.3.5"}, % strict semver, bump manually!
|
{vsn, "4.3.6"}, % strict semver, bump manually!
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, [emqx_web_hook_sup]},
|
{registered, [emqx_web_hook_sup]},
|
||||||
{applications, [kernel,stdlib,ehttpc]},
|
{applications, [kernel,stdlib,ehttpc]},
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
{load_module, emqx_web_hook, brutal_purge, soft_purge, []},
|
{load_module, emqx_web_hook, brutal_purge, soft_purge, []},
|
||||||
{load_module, emqx_web_hook_actions, brutal_purge, soft_purge, []}
|
{load_module, emqx_web_hook_actions, brutal_purge, soft_purge, []}
|
||||||
]},
|
]},
|
||||||
{<<"4.3.[3-4]">>, [
|
{<<"4.3.[3-5]">>, [
|
||||||
{load_module, emqx_web_hook_actions, brutal_purge, soft_purge, []}
|
{load_module, emqx_web_hook_actions, brutal_purge, soft_purge, []}
|
||||||
]},
|
]},
|
||||||
{<<".*">>, []}
|
{<<".*">>, []}
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
{load_module, emqx_web_hook, brutal_purge, soft_purge, []},
|
{load_module, emqx_web_hook, brutal_purge, soft_purge, []},
|
||||||
{load_module, emqx_web_hook_actions, brutal_purge, soft_purge, []}
|
{load_module, emqx_web_hook_actions, brutal_purge, soft_purge, []}
|
||||||
]},
|
]},
|
||||||
{<<"4.3.[3-4]">>, [
|
{<<"4.3.[3-5]">>, [
|
||||||
{load_module, emqx_web_hook_actions, brutal_purge, soft_purge, []}
|
{load_module, emqx_web_hook_actions, brutal_purge, soft_purge, []}
|
||||||
]},
|
]},
|
||||||
{<<".*">>, []}
|
{<<".*">>, []}
|
||||||
|
|
|
@ -345,7 +345,7 @@ pool_opts(Params = #{<<"url">> := URL}, ResId) ->
|
||||||
cuttlefish_duration:parse(str(maps:get(<<"connect_timeout">>, Params, <<"5s">>))),
|
cuttlefish_duration:parse(str(maps:get(<<"connect_timeout">>, Params, <<"5s">>))),
|
||||||
TransportOpts0 =
|
TransportOpts0 =
|
||||||
case Scheme =:= https of
|
case Scheme =:= https of
|
||||||
true -> [get_ssl_opts(Params, ResId)];
|
true -> get_ssl_opts(Params, ResId);
|
||||||
false -> []
|
false -> []
|
||||||
end,
|
end,
|
||||||
TransportOpts = emqx_misc:ipv6_probe(TransportOpts0),
|
TransportOpts = emqx_misc:ipv6_probe(TransportOpts0),
|
||||||
|
|
|
@ -64,7 +64,7 @@ translate_env() ->
|
||||||
SNI0 -> SNI0
|
SNI0 -> SNI0
|
||||||
end,
|
end,
|
||||||
TLSOpts = lists:filter(fun({_K, V}) ->
|
TLSOpts = lists:filter(fun({_K, V}) ->
|
||||||
V /= <<>> andalso V /= undefined andalso V /= "" andalso true
|
V /= <<>> andalso V /= undefined andalso V /= ""
|
||||||
end, [{keyfile, KeyFile},
|
end, [{keyfile, KeyFile},
|
||||||
{certfile, CertFile},
|
{certfile, CertFile},
|
||||||
{cacertfile, CACertFile},
|
{cacertfile, CACertFile},
|
||||||
|
|
Loading…
Reference in New Issue