From 5e9462afc8377e01dedee184b4364d013dba88f9 Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Wed, 3 Aug 2022 10:46:15 -0300 Subject: [PATCH] feat: add option to gc after TLS/SSL handshake (4.3) Port of https://github.com/emqx/emqx/pull/8637 --- CHANGES-4.3.md | 1 + apps/emqx_sn/rebar.config | 2 +- etc/emqx.conf | 7 +++++++ priv/emqx.schema | 9 ++++++++- rebar.config | 2 +- 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CHANGES-4.3.md b/CHANGES-4.3.md index db82c8eb1..a9d89473e 100644 --- a/CHANGES-4.3.md +++ b/CHANGES-4.3.md @@ -16,6 +16,7 @@ File format: - Upgrade Erlang/OTP from 23.2.7.2-emqx-3 to 23.3.4.9-3 [#8511](https://github.com/emqx/emqx/pull/8511) - Make possible to debug-print SSL handshake procedure by setting listener config `log_level=debug` [#8553](https://github.com/emqx/emqx/pull/8553) +- Add option to perform GC on connection process after TLS/SSL handshake is performed. [#8649](https://github.com/emqx/emqx/pull/8649) ## v4.3.17 diff --git a/apps/emqx_sn/rebar.config b/apps/emqx_sn/rebar.config index 120d4767d..295751b23 100644 --- a/apps/emqx_sn/rebar.config +++ b/apps/emqx_sn/rebar.config @@ -2,7 +2,7 @@ {plugins, [rebar3_proper]}. {deps, - [{esockd, {git, "https://github.com/emqx/esockd", {tag, "5.8.5"}}}, + [{esockd, {git, "https://github.com/emqx/esockd", {tag, "5.8.7"}}}, {cuttlefish, {git, "https://github.com/emqx/cuttlefish", {tag, "v3.0.0"}}} ]}. diff --git a/etc/emqx.conf b/etc/emqx.conf index a31412ea8..f7dccfd27 100644 --- a/etc/emqx.conf +++ b/etc/emqx.conf @@ -1644,6 +1644,13 @@ listener.ssl.external.ciphers = TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TL ## Value: true | false listener.ssl.external.reuseaddr = true +## Whether to perform GC after TLS/SSL handshake. +## +## Default: false +## +## Value: true | false +## listener.ssl.external.gc_after_handshake = false + ##-------------------------------------------------------------------- ## External WebSocket listener for MQTT protocol diff --git a/priv/emqx.schema b/priv/emqx.schema index 48d31bfbd..b6b267abf 100644 --- a/priv/emqx.schema +++ b/priv/emqx.schema @@ -1599,6 +1599,11 @@ end}. {datatype, {enum, [emergency, alert, critical, error, warning, notice, info, debug, none, all]}} ]}. +{mapping, "listener.ssl.$name.gc_after_handshake", "emqx.listeners", [ + {default, false}, + {datatype, {enum, [true, false]}} +]}. + %%-------------------------------------------------------------------- %% MQTT/WebSocket Listeners @@ -2055,6 +2060,7 @@ end}. {datatype, {enum, [emergency, alert, critical, error, warning, notice, info, debug, none, all]}} ]}. + {translation, "emqx.listeners", fun(Conf) -> Filter = fun(Opts) -> [{K, V} || {K, V} <- Opts, V =/= undefined] end, @@ -2221,7 +2227,8 @@ end}. {secure_renegotiate, cuttlefish:conf_get(Prefix ++ ".secure_renegotiate", Conf, undefined)}, {reuse_sessions, cuttlefish:conf_get(Prefix ++ ".reuse_sessions", Conf, undefined)}, {honor_cipher_order, cuttlefish:conf_get(Prefix ++ ".honor_cipher_order", Conf, undefined)}, - {log_level, cuttlefish:conf_get(Prefix ++ ".log_level", Conf, undefined)} + {log_level, cuttlefish:conf_get(Prefix ++ ".log_level", Conf, undefined)}, + {gc_after_handshake, cuttlefish:conf_get(Prefix ++ ".gc_after_handshake", Conf, undefined)} ]) end, diff --git a/rebar.config b/rebar.config index cf46d87c9..daddc8b97 100644 --- a/rebar.config +++ b/rebar.config @@ -45,7 +45,7 @@ , {gproc, {git, "https://github.com/uwiger/gproc", {tag, "0.8.0"}}} , {jiffy, {git, "https://github.com/emqx/jiffy", {tag, "1.0.5"}}} , {cowboy, {git, "https://github.com/emqx/cowboy", {tag, "2.8.2"}}} - , {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.8.6"}}} + , {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.8.7"}}} , {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.8.1.11"}}} , {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "2.5.2"}}} , {cuttlefish, {git, "https://github.com/emqx/cuttlefish", {tag, "v3.3.6"}}}