summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2011-02-07 11:27:47 +0000
committerSimon MacMullen <simon@rabbitmq.com>2011-02-07 11:27:47 +0000
commit75622e319705ce12e9243ada85af2441af88fa4c (patch)
tree6625ecaa71f1b64cce9994dd81bd2446b080dbad
parent709ed272ed055c1a6473f577cfffe772d040c55a (diff)
downloadrabbitmq-server-75622e319705ce12e9243ada85af2441af88fa4c.tar.gz
Fix SSL connections in R13Bx.
-rw-r--r--src/rabbit_reader.erl18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index b5d82ac2..09fe74d0 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -864,13 +864,13 @@ i(peer_port, #v1{sock = Sock}) ->
i(ssl, #v1{sock = Sock}) ->
rabbit_net:is_ssl(Sock);
i(ssl_protocol, #v1{sock = Sock}) ->
- ssl_info(fun ({P, _}) -> P end, Sock);
+ ssl_info(fun ({P, _, _, _}) -> P end, Sock);
i(ssl_key_exchange, #v1{sock = Sock}) ->
- ssl_info(fun ({_, {K, _, _}}) -> K end, Sock);
+ ssl_info(fun ({_, K, _, _}) -> K end, Sock);
i(ssl_cipher, #v1{sock = Sock}) ->
- ssl_info(fun ({_, {_, C, _}}) -> C end, Sock);
+ ssl_info(fun ({_, _, C, _}) -> C end, Sock);
i(ssl_hash, #v1{sock = Sock}) ->
- ssl_info(fun ({_, {_, _, H}}) -> H end, Sock);
+ ssl_info(fun ({_, _, _, H}) -> H end, Sock);
i(peer_cert_issuer, #v1{sock = Sock}) ->
cert_info(fun rabbit_ssl:peer_cert_issuer/1, Sock);
i(peer_cert_subject, #v1{sock = Sock}) ->
@@ -922,10 +922,14 @@ socket_info(Get, Select) ->
end.
ssl_info(F, Sock) ->
+ %% The first ok form is R14
+ %% The second is R13 - the extra term is exportability (by inspection,
+ %% the docs are wrong)
case rabbit_net:ssl_info(Sock) of
- nossl -> '';
- {error, _} -> '';
- {ok, Info} -> F(Info)
+ nossl -> '';
+ {error, _} -> '';
+ {ok, {P, {K, C, H}}} -> F({P, K, C, H});
+ {ok, {P, {K, C, H, _}}} -> F({P, K, C, H})
end.
cert_info(F, Sock) ->