fix: remove enable from server_ssl_opts_schema

This commit is contained in:
Zhongwen Deng 2022-05-11 22:03:48 +08:00
parent e0054f6a4e
commit e929da2e68
4 changed files with 11 additions and 14 deletions

View File

@ -1316,7 +1316,7 @@ Specifies the size of the compression context for the client.
} }
} }
common_ssl_opts_schema_enable { client_ssl_opts_schema_enable {
desc { desc {
en: """ en: """
Enable TLS. Enable TLS.

View File

@ -493,11 +493,8 @@ limiter(Opts) ->
ssl_opts(Opts) -> ssl_opts(Opts) ->
maps:to_list( maps:to_list(
emqx_tls_lib:drop_tls13_for_old_otp( emqx_tls_lib:drop_tls13_for_old_otp(
maps:without(
[enable],
maps:get(ssl, Opts, #{}) maps:get(ssl, Opts, #{})
) )
)
). ).
tcp_opts(Opts) -> tcp_opts(Opts) ->

View File

@ -1690,14 +1690,6 @@ common_ssl_opts_schema(Defaults) ->
D = fun(Field) -> maps:get(to_atom(Field), Defaults, undefined) end, D = fun(Field) -> maps:get(to_atom(Field), Defaults, undefined) end,
Df = fun(Field, Default) -> maps:get(to_atom(Field), Defaults, Default) end, Df = fun(Field, Default) -> maps:get(to_atom(Field), Defaults, Default) end,
[ [
{"enable",
sc(
boolean(),
#{
default => Df("enable", false),
desc => ?DESC(common_ssl_opts_schema_enable)
}
)},
{"cacertfile", {"cacertfile",
sc( sc(
binary(), binary(),
@ -1846,6 +1838,14 @@ server_ssl_opts_schema(Defaults, IsRanchListener) ->
client_ssl_opts_schema(Defaults) -> client_ssl_opts_schema(Defaults) ->
common_ssl_opts_schema(Defaults) ++ common_ssl_opts_schema(Defaults) ++
[ [
{"enable",
sc(
boolean(),
#{
default => false,
desc => ?DESC(client_ssl_opts_schema_enable)
}
)},
{"server_name_indication", {"server_name_indication",
sc( sc(
hoconsc:union([disable, string()]), hoconsc:union([disable, string()]),

View File

@ -87,7 +87,7 @@ fields("https") ->
bind(18804) bind(18804)
| common_listener_fields() ++ | common_listener_fields() ++
exclude_fields( exclude_fields(
["enable", "fail_if_no_peer_cert"], ["fail_if_no_peer_cert"],
emqx_schema:server_ssl_opts_schema(#{}, true) emqx_schema:server_ssl_opts_schema(#{}, true)
) )
]. ].