diff options
| author | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2020-05-14 11:32:21 +0200 |
|---|---|---|
| committer | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2020-05-14 11:36:44 +0200 |
| commit | 396b3e9998db85722acdb81d584993427a1c70c6 (patch) | |
| tree | b1d32e8d5dabe40a82557d8b5889fbecaa19e191 | |
| parent | 131b77b0274258980caaaf008fbb91926a6ea7cd (diff) | |
| download | rabbitmq-server-git-396b3e9998db85722acdb81d584993427a1c70c6.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).
| -rw-r--r-- | src/rabbit_reader.erl | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl index b7738e1637..982b2dce24 100644 --- a/src/rabbit_reader.erl +++ b/src/rabbit_reader.erl @@ -1560,14 +1560,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}) -> @@ -1583,7 +1579,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), |
