[Opt|Opts].
-type resource_conflict() :: setresource | closeold | closenew | acceptnew.
--spec opt_type(c2s_certfile) -> fun((binary()) -> binary());
- (c2s_ciphers) -> fun((binary()) -> binary());
+-spec opt_type(c2s_ciphers) -> fun((binary()) -> binary());
(c2s_dhfile) -> fun((binary()) -> binary());
(c2s_cafile) -> fun((binary()) -> binary());
(c2s_protocol_options) -> fun(([binary()]) -> binary());
(resource_conflict) -> fun((resource_conflict()) -> resource_conflict());
(disable_sasl_mechanisms) -> fun((binary() | [binary()]) -> [binary()]);
(atom()) -> [atom()].
-opt_type(c2s_certfile = Opt) ->
- fun(File) ->
- ?WARNING_MSG("option '~s' is deprecated, use 'certfiles' instead", [Opt]),
- misc:try_read_file(File)
- end;
opt_type(c2s_ciphers) -> fun iolist_to_binary/1;
opt_type(c2s_dhfile) -> fun misc:try_read_file/1;
opt_type(c2s_cafile) -> fun misc:try_read_file/1;
(V) -> [str:to_upper(V)]
end;
opt_type(_) ->
- [c2s_certfile, c2s_ciphers, c2s_cafile, c2s_dhfile,
+ [c2s_ciphers, c2s_cafile, c2s_dhfile,
c2s_protocol_options, c2s_tls_compression, resource_conflict,
disable_sasl_mechanisms].
(cache_size) -> fun((timeout()) -> timeout());
(cache_missed) -> fun((boolean()) -> boolean());
(cache_life_time) -> fun((timeout()) -> timeout());
- (domain_certfile) -> fun((binary()) -> binary());
(shared_key) -> fun((binary()) -> binary());
(node_start) -> fun((non_neg_integer()) -> non_neg_integer());
(atom()) -> [atom()].
(infinity) -> infinity;
(unlimited) -> infinity
end;
-opt_type(domain_certfile = Opt) ->
- fun(File) ->
- ?WARNING_MSG("option '~s' is deprecated, use 'certfiles' instead", [Opt]),
- misc:try_read_file(File)
- end;
opt_type(shared_key) ->
fun iolist_to_binary/1;
opt_type(node_start) ->
[hide_sensitive_log_data, hosts, language, max_fsm_queue,
default_db, default_ram_db, queue_type, queue_dir, loglevel,
use_cache, cache_size, cache_missed, cache_life_time,
- domain_certfile, shared_key, node_start].
+ shared_key, node_start].
-spec may_hide_data(any()) -> any().
may_hide_data(Data) ->
fun(CertList) ->
[binary_to_list(Path) || Path <- CertList]
end;
+opt_type(O) when O == c2s_certfile; O == s2s_certfile; O == domain_certfile ->
+ fun(File) ->
+ ?WARNING_MSG("option '~s' is deprecated, use 'certfiles' instead", [O]),
+ misc:try_read_file(File)
+ end;
opt_type(_) ->
- [ca_path, certfiles].
+ [ca_path, certfiles, c2s_certfile, s2s_certfile, domain_certfile].
%%%===================================================================
%%% gen_server callbacks
-type use_starttls() :: boolean() | optional | required | required_trusted.
-spec opt_type(route_subdomains) -> fun((s2s | local) -> s2s | local);
(s2s_access) -> fun((any()) -> any());
- (s2s_certfile) -> fun((binary()) -> binary());
(s2s_ciphers) -> fun((binary()) -> binary());
(s2s_dhfile) -> fun((binary()) -> binary());
(s2s_cafile) -> fun((binary()) -> binary());
end;
opt_type(s2s_access) ->
fun acl:access_rules_validator/1;
-opt_type(s2s_certfile = Opt) ->
- fun(File) ->
- ?WARNING_MSG("option '~s' is deprecated, use 'certfiles' instead", [Opt]),
- misc:try_read_file(File)
- end;
opt_type(s2s_ciphers) -> fun iolist_to_binary/1;
opt_type(s2s_dhfile) -> fun misc:try_read_file/1;
opt_type(s2s_cafile) -> fun misc:try_read_file/1;
opt_type(s2s_queue_type) ->
fun(ram) -> ram; (file) -> file end;
opt_type(_) ->
- [route_subdomains, s2s_access, s2s_certfile, s2s_zlib,
+ [route_subdomains, s2s_access, s2s_zlib,
s2s_ciphers, s2s_dhfile, s2s_cafile, s2s_protocol_options,
s2s_tls_compression, s2s_use_starttls, s2s_timeout, s2s_queue_type].