We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 18533d4 + 11e56bd commit d5b8832Copy full SHA for d5b8832
deps/rabbit/src/rabbit_reader.erl
@@ -1119,7 +1119,17 @@ handle_input({frame_payload, Type, Channel, PayloadSize}, Data, State) ->
1119
handle_input(handshake, <<"AMQP", A, B, C, D, Rest/binary>>, State) ->
1120
{Rest, version_negotiation({A, B, C, D}, State)};
1121
handle_input(handshake, <<Other:8/binary, _/binary>>, #v1{sock = Sock}) ->
1122
- refuse_connection(Sock, {bad_header, Other});
+ Reason = case Other of
1123
+ <<16#16, 16#03, _Ver2, _Len1, _Len2, 16#01, _, _>> ->
1124
+ %% Looks like a TLS client hello.
1125
+ detected_unexpected_tls_header;
1126
+ <<"GET ", _URL/binary>> ->
1127
+ %% Looks like an HTTP request.
1128
+ detected_unexpected_http_header;
1129
+ _ ->
1130
+ bad_header
1131
+ end,
1132
+ refuse_connection(Sock, {Reason, Other});
1133
handle_input(Callback, Data, _State) ->
1134
throw({bad_input, Callback, Data}).
1135
0 commit comments