Skip to content

Commit 5a6dbef

Browse files
committed
Return TLS port in stream connection properties
1 parent 69ad696 commit 5a6dbef

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

deps/rabbitmq_stream/src/rabbit_stream_reader.erl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,10 @@ handle_frame_pre_auth(_Transport,
10511051
heartbeater = Heartbeater},
10521052
State};
10531053
handle_frame_pre_auth(Transport,
1054-
#stream_connection{user = User, socket = S} = Connection,
1054+
#stream_connection{user = User,
1055+
socket = S,
1056+
transport = TransportLayer} =
1057+
Connection,
10551058
State,
10561059
{request, CorrelationId, {open, VirtualHost}}) ->
10571060
%% FIXME enforce connection limit (see rabbit_reader:is_over_connection_limit/2)
@@ -1063,8 +1066,14 @@ handle_frame_pre_auth(Transport,
10631066
#{}),
10641067
AdvertisedHost = rabbit_stream:host(),
10651068
AdvertisedPort =
1066-
rabbit_data_coercion:to_binary(
1067-
rabbit_stream:port()),
1069+
case TransportLayer of
1070+
tcp ->
1071+
rabbit_data_coercion:to_binary(
1072+
rabbit_stream:port());
1073+
ssl ->
1074+
rabbit_data_coercion:to_binary(
1075+
rabbit_stream:tls_port())
1076+
end,
10681077

10691078
ConnectionProperties =
10701079
#{<<"advertised_host">> => AdvertisedHost,

0 commit comments

Comments
 (0)