Skip to content

Commit 379f29f

Browse files
Merge pull request #3399 from rabbitmq/mergify/bp/v3.9.x/pr-3392
Update Ranch to 2.1 (backport #3392)
2 parents 612b4f7 + ec1f66c commit 379f29f

File tree

2 files changed

+11
-20
lines changed

2 files changed

+11
-20
lines changed

deps/rabbit_common/src/rabbit_net.erl

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -100,26 +100,12 @@ ssl_info(_Sock) ->
100100
nossl.
101101

102102
proxy_ssl_info(Sock, {rabbit_proxy_socket, _, ProxyInfo}) ->
103-
case ProxyInfo of
104-
#{ssl := #{version := Version, cipher := Cipher}} ->
105-
Proto = case Version of
106-
<<"SSL3">> -> 'ssl3';
107-
<<"TLSv1">> -> 'tlsv1';
108-
<<"TLSv1.1">> -> 'tlsv1.1';
109-
<<"TLSv1.2">> -> 'tlsv1.2';
110-
<<"TLSv1.3">> -> 'tlsv1.3';
111-
_ -> nossl
112-
end,
113-
CipherSuite = case ssl:str_to_suite(binary_to_list(Cipher)) of
114-
#{} = CS -> CS;
115-
_ -> nossl
116-
end,
117-
case {Proto, CipherSuite} of
118-
{nossl, _} -> ssl_info(Sock);
119-
{_, nossl} -> ssl_info(Sock);
120-
_ -> {ok, [{protocol, Proto}, {selected_cipher_suite, CipherSuite}]}
121-
end;
122-
_ ->
103+
ConnInfo = ranch_proxy_header:to_connection_info(ProxyInfo),
104+
case lists:keymember(protocol, 1, ConnInfo) andalso
105+
lists:keymember(selected_cipher_suite, 1, ConnInfo) of
106+
true ->
107+
{ok, ConnInfo};
108+
false ->
123109
ssl_info(Sock)
124110
end;
125111
proxy_ssl_info(Sock, _) ->

rabbitmq-components.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,13 @@ dep_cowlib = hex 2.9.1
116116
dep_jsx = hex 3.1.0
117117
dep_looking_glass = git https://github.com/rabbitmq/looking_glass master
118118
dep_prometheus = hex 4.8.1
119+
<<<<<<< HEAD
119120
dep_ra = hex 2.0.0
120121
dep_ranch = hex 2.0.0
122+
=======
123+
dep_ra = git https://github.com/rabbitmq/ra.git master
124+
dep_ranch = hex 2.1.0
125+
>>>>>>> d327e8a7cb (Update Ranch to 2.1.0)
121126
dep_recon = hex 2.5.1
122127
dep_observer_cli = hex 1.6.2
123128
dep_stdout_formatter = hex 0.2.4

0 commit comments

Comments
 (0)