mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-22 17:28:25 +01:00
Accept a list in c2s_ciphers/s2s_ciphers options
This commit is contained in:
parent
3a46612d88
commit
bb26d7c379
@ -74,13 +74,19 @@ opt_type(auth_use_cache) ->
|
|||||||
opt_type(c2s_cafile) ->
|
opt_type(c2s_cafile) ->
|
||||||
econf:file();
|
econf:file();
|
||||||
opt_type(c2s_ciphers) ->
|
opt_type(c2s_ciphers) ->
|
||||||
econf:binary();
|
fun(L) when is_list(L) ->
|
||||||
|
(econf:and_then(
|
||||||
|
econf:list(econf:binary(), [unique]),
|
||||||
|
concat_binary($:)))(L);
|
||||||
|
(B) ->
|
||||||
|
(econf:binary())(B)
|
||||||
|
end;
|
||||||
opt_type(c2s_dhfile) ->
|
opt_type(c2s_dhfile) ->
|
||||||
econf:file();
|
econf:file();
|
||||||
opt_type(c2s_protocol_options) ->
|
opt_type(c2s_protocol_options) ->
|
||||||
econf:and_then(
|
econf:and_then(
|
||||||
econf:list(econf:binary(), [unique]),
|
econf:list(econf:binary(), [unique]),
|
||||||
fun concat_tls_protocol_options/1);
|
concat_binary($|));
|
||||||
opt_type(c2s_tls_compression) ->
|
opt_type(c2s_tls_compression) ->
|
||||||
econf:bool();
|
econf:bool();
|
||||||
opt_type(ca_file) ->
|
opt_type(ca_file) ->
|
||||||
@ -302,7 +308,7 @@ opt_type(s2s_access) ->
|
|||||||
opt_type(s2s_cafile) ->
|
opt_type(s2s_cafile) ->
|
||||||
econf:pem();
|
econf:pem();
|
||||||
opt_type(s2s_ciphers) ->
|
opt_type(s2s_ciphers) ->
|
||||||
econf:binary();
|
opt_type(c2s_ciphers);
|
||||||
opt_type(s2s_dhfile) ->
|
opt_type(s2s_dhfile) ->
|
||||||
econf:file();
|
econf:file();
|
||||||
opt_type(s2s_dns_retries) ->
|
opt_type(s2s_dns_retries) ->
|
||||||
@ -312,9 +318,7 @@ opt_type(s2s_dns_timeout) ->
|
|||||||
opt_type(s2s_max_retry_delay) ->
|
opt_type(s2s_max_retry_delay) ->
|
||||||
econf:timeout(second);
|
econf:timeout(second);
|
||||||
opt_type(s2s_protocol_options) ->
|
opt_type(s2s_protocol_options) ->
|
||||||
econf:and_then(
|
opt_type(c2s_protocol_options);
|
||||||
econf:list(econf:binary(), [unique]),
|
|
||||||
fun concat_tls_protocol_options/1);
|
|
||||||
opt_type(s2s_queue_type) ->
|
opt_type(s2s_queue_type) ->
|
||||||
econf:enum([ram, file]);
|
econf:enum([ram, file]);
|
||||||
opt_type(s2s_timeout) ->
|
opt_type(s2s_timeout) ->
|
||||||
@ -434,6 +438,8 @@ opt_type(jwt_auth_only_rule) ->
|
|||||||
%% automatically by tools/opt_type.sh script
|
%% automatically by tools/opt_type.sh script
|
||||||
-spec options() -> [{s2s_protocol_options, undefined | binary()} |
|
-spec options() -> [{s2s_protocol_options, undefined | binary()} |
|
||||||
{c2s_protocol_options, undefined | binary()} |
|
{c2s_protocol_options, undefined | binary()} |
|
||||||
|
{s2s_ciphers, undefined | binary()} |
|
||||||
|
{c2s_ciphers, undefined | binary()} |
|
||||||
{websocket_origin, [binary()]} |
|
{websocket_origin, [binary()]} |
|
||||||
{disable_sasl_mechanisms, [binary()]} |
|
{disable_sasl_mechanisms, [binary()]} |
|
||||||
{s2s_zlib, boolean()} |
|
{s2s_zlib, boolean()} |
|
||||||
@ -750,6 +756,6 @@ fqdn(global) ->
|
|||||||
fqdn(_) ->
|
fqdn(_) ->
|
||||||
ejabberd_config:get_option(fqdn).
|
ejabberd_config:get_option(fqdn).
|
||||||
|
|
||||||
-spec concat_tls_protocol_options([binary()]) -> binary().
|
-spec concat_binary(char()) -> fun(([binary()]) -> binary()).
|
||||||
concat_tls_protocol_options(Opts) ->
|
concat_binary(C) ->
|
||||||
str:join(Opts, <<"|">>).
|
fun(Opts) -> str:join(Opts, <<C>>) end.
|
||||||
|
Loading…
Reference in New Issue
Block a user