diff options
author | Alexey Shchepin <alexey@process-one.net> | 2015-06-16 11:59:06 +0300 |
---|---|---|
committer | Alexey Shchepin <alexey@process-one.net> | 2015-06-16 11:59:06 +0300 |
commit | 2110b929bcf5353f959e195ffafd41dfae2d55d8 (patch) | |
tree | 2840bea2834c9240cf3f11f6886b029e65bd7559 | |
parent | Add option to set net_ticktime (EJAB-1742) (diff) | |
parent | New options: dhfile and s2s_dhfile (diff) |
Merge pull request #581 from weiss/dh-param-file
New options: dhfile and s2s_dhfile
-rw-r--r-- | src/ejabberd_c2s.erl | 1 | ||||
-rw-r--r-- | src/ejabberd_http.erl | 1 | ||||
-rw-r--r-- | src/ejabberd_s2s_in.erl | 9 | ||||
-rw-r--r-- | src/ejabberd_s2s_out.erl | 9 |
4 files changed, 16 insertions, 4 deletions
diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index 330660925..563a7df35 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -283,6 +283,7 @@ init([{SockMod, Socket}, Opts]) -> StartTLSRequired orelse TLSEnabled, TLSOpts1 = lists:filter(fun ({certfile, _}) -> true; ({ciphers, _}) -> true; + ({dhfile, _}) -> true; (_) -> false end, Opts), diff --git a/src/ejabberd_http.erl b/src/ejabberd_http.erl index 5f98063bb..1702e9be6 100644 --- a/src/ejabberd_http.erl +++ b/src/ejabberd_http.erl @@ -96,6 +96,7 @@ init({SockMod, Socket}, Opts) -> TLSEnabled = proplists:get_bool(tls, Opts), TLSOpts1 = lists:filter(fun ({certfile, _}) -> true; ({ciphers, _}) -> true; + ({dhfile, _}) -> true; (_) -> false end, Opts), diff --git a/src/ejabberd_s2s_in.erl b/src/ejabberd_s2s_in.erl index 067eb98b2..d890f0bce 100644 --- a/src/ejabberd_s2s_in.erl +++ b/src/ejabberd_s2s_in.erl @@ -185,9 +185,14 @@ init([{SockMod, Socket}, Opts]) -> undefined -> TLSOpts2; ProtocolOpts -> [{protocol_options, ProtocolOpts} | TLSOpts2] end, + TLSOpts4 = case ejabberd_config:get_option( + s2s_dhfile, fun iolist_to_binary/1) of + undefined -> TLSOpts3; + DHFile -> [{dhfile, DHFile} | TLSOpts3] + end, TLSOpts = case proplists:get_bool(tls_compression, Opts) of - false -> [compression_none | TLSOpts3]; - true -> TLSOpts3 + false -> [compression_none | TLSOpts4]; + true -> TLSOpts4 end, Timer = erlang:start_timer(?S2STIMEOUT, self(), []), {ok, wait_for_stream, diff --git a/src/ejabberd_s2s_out.erl b/src/ejabberd_s2s_out.erl index 733dbe0a7..7abc81775 100644 --- a/src/ejabberd_s2s_out.erl +++ b/src/ejabberd_s2s_out.erl @@ -197,13 +197,18 @@ init([From, Server, Type]) -> undefined -> TLSOpts2; ProtocolOpts -> [{protocol_options, ProtocolOpts} | TLSOpts2] end, + TLSOpts4 = case ejabberd_config:get_option( + s2s_dhfile, fun iolist_to_binary/1) of + undefined -> TLSOpts3; + DHFile -> [{dhfile, DHFile} | TLSOpts3] + end, TLSOpts = case ejabberd_config:get_option( {s2s_tls_compression, From}, fun(true) -> true; (false) -> false end, true) of - false -> [compression_none | TLSOpts3]; - true -> TLSOpts3 + false -> [compression_none | TLSOpts4]; + true -> TLSOpts4 end, {New, Verify} = case Type of {new, Key} -> {Key, false}; |