Merge pull request #7920 from zhongwencool/remove-enable-from-server-ssl-options

fix: remove enable from server_ssl_opts_schema
This commit is contained in:
zhongwencool 2022-05-12 14:47:26 +08:00 committed by GitHub
commit dbfbdb930f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 {
en: """
Enable TLS.

View File

@ -495,10 +495,7 @@ limiter(Opts) ->
ssl_opts(Opts) ->
maps:to_list(
emqx_tls_lib:drop_tls13_for_old_otp(
maps:without(
[enable],
maps:get(ssl, Opts, #{})
)
maps:get(ssl, Opts, #{})
)
).

View File

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

View File

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