summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2020-05-14 11:32:21 +0200
committerJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2020-05-14 14:25:35 +0200
commit3ad5c993a1f57c3c26ae5967db2eb8a13e424751 (patch)
tree7cd91a27fa6b12ad682765027565172985777d0e
parentdf81d49be080871cb801b784246ff67bf6c5a1cd (diff)
downloadrabbitmq-server-git-3ad5c993a1f57c3c26ae5967db2eb8a13e424751.tar.gz
rabbit_reader: Use `selected_cipher_suite` instead of `cipher_suite`
... in the ssl:connection_information/1 returned proplist. `cipher_suite` no longer exists in Erlang Git as of this commit (it is deprecated in the documentation for quite some time). However, `selected_cipher_suite` is supported in at least Erlang 21+, so let's use this one. While here, fix indentation (tab instead of spaces). (cherry picked from commit 396b3e9998db85722acdb81d584993427a1c70c6)
-rw-r--r--src/rabbit_reader.erl14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index defc7a7fd7..5a3623bedf 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -1511,14 +1511,10 @@ ssl_info(F, #v1{sock = Sock}) ->
{error, _} -> '';
{ok, Items} ->
P = proplists:get_value(protocol, Items),
- CS = proplists:get_value(cipher_suite, Items),
- %% The first form is R14.
- %% The second is R13 - the extra term is exportability (by
- %% inspection, the docs are wrong).
- case CS of
- {K, C, H} -> F({P, {K, C, H}});
- {K, C, H, _} -> F({P, {K, C, H}})
- end
+ #{cipher := C,
+ key_exchange := K,
+ mac := H} = proplists:get_value(selected_cipher_suite, Items),
+ F({P, {K, C, H}})
end.
cert_info(F, #v1{sock = Sock}) ->
@@ -1534,7 +1530,7 @@ maybe_emit_stats(State) ->
emit_stats(State) ->
[{_, Pid}, {_, Recv_oct}, {_, Send_oct}, {_, Reductions}] = I
- = infos(?SIMPLE_METRICS, State),
+ = infos(?SIMPLE_METRICS, State),
Infos = infos(?OTHER_METRICS, State),
rabbit_core_metrics:connection_stats(Pid, Infos),
rabbit_core_metrics:connection_stats(Pid, Recv_oct, Send_oct, Reductions),