summaryrefslogtreecommitdiff
path: root/src/ejabberd_c2s.erl
diff options
context:
space:
mode:
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>2017-05-12 16:27:09 +0300
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>2017-05-12 16:27:09 +0300
commitcc58ce6301a6a60d5b3f67fb17731200572fff4b (patch)
tree978f0d2d55eafdb4431142a2c07ac95fe6348a1f /src/ejabberd_c2s.erl
parentCheck presence of some files during option validation (diff)
Introduce Certficate Manager
The major goal is to simplify certificate management in ejabberd. Currently it requires some effort from a user to configure certficates, especially in the situation where a lot of virtual domains are hosted. The task is splitted in several sub-tasks: * Implement basic certificate validator. The validator should check all configured certificates for existence, validity, duration and so on. The validator should not perform any actions in the case of errors except logging an error message. This is actually implemented by this commit. * All certificates should be configured inside a single section (something like 'certfiles') where ejabberd should parse them, check the full-chain, find the corresponding private keys and, if needed, resort chains and split the certficates into separate files for easy to use by fast_tls. * Options like 'domain_certfile', 'c2s_certfile' or 's2s_certfile' should probably be deprecated, since the process of matching certificates with the corresponding virtual hosts should be done automatically and these options only introduce configuration errors without any meaningful purpose.
Diffstat (limited to 'src/ejabberd_c2s.erl')
-rw-r--r--src/ejabberd_c2s.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl
index ac48444c..0ac39518 100644
--- a/src/ejabberd_c2s.erl
+++ b/src/ejabberd_c2s.erl
@@ -949,7 +949,11 @@ opt_type(_) ->
(atom()) -> [atom()].
listen_opt_type(access) -> fun acl:access_rules_validator/1;
listen_opt_type(shaper) -> fun acl:shaper_rules_validator/1;
-listen_opt_type(certfile) -> opt_type(c2s_certfile);
+listen_opt_type(certfile) ->
+ fun(S) ->
+ ejabberd_pkix:add_certfile(S),
+ iolist_to_binary(S)
+ end;
listen_opt_type(ciphers) -> opt_type(c2s_ciphers);
listen_opt_type(dhfile) -> opt_type(c2s_dhfile);
listen_opt_type(cafile) -> opt_type(c2s_cafile);