26
1
mirror of https://github.com/processone/ejabberd.git synced 2025-01-03 18:02:28 +01:00

Merge remote-tracking branch 'processone/pr/1914'

* processone/pr/1914:
  ejabberd_c2s: Fix priority of 'certfile' option
This commit is contained in:
Holger Weiss 2017-08-05 19:27:43 +02:00
commit b673539a2a

View File

@ -297,14 +297,19 @@ process_terminated(State, _Reason) ->
%%%=================================================================== %%%===================================================================
%%% xmpp_stream_in callbacks %%% xmpp_stream_in callbacks
%%%=================================================================== %%%===================================================================
tls_options(#{lserver := LServer, tls_options := DefaultOpts}) -> tls_options(#{lserver := LServer, tls_options := DefaultOpts,
TLSOpts1 = case ejabberd_config:get_option( stream_encrypted := Encrypted}) ->
TLSOpts1 = case {Encrypted, proplists:get_value(certfile, DefaultOpts)} of
{true, CertFile} when CertFile /= undefined -> DefaultOpts;
{_, _} ->
case ejabberd_config:get_option(
{c2s_certfile, LServer}, {c2s_certfile, LServer},
ejabberd_config:get_option( ejabberd_config:get_option(
{domain_certfile, LServer})) of {domain_certfile, LServer})) of
undefined -> DefaultOpts; undefined -> DefaultOpts;
CertFile -> lists:keystore(certfile, 1, DefaultOpts, CertFile -> lists:keystore(certfile, 1, DefaultOpts,
{certfile, CertFile}) {certfile, CertFile})
end
end, end,
TLSOpts2 = case ejabberd_config:get_option( TLSOpts2 = case ejabberd_config:get_option(
{c2s_ciphers, LServer}) of {c2s_ciphers, LServer}) of