Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Protocol parsing fails when haproxy and tls protocols are both enabled #7008

Closed
3 tasks done
RongtongJin opened this issue Jul 9, 2023 · 0 comments · Fixed by #7009
Closed
3 tasks done

[Bug] Protocol parsing fails when haproxy and tls protocols are both enabled #7008

RongtongJin opened this issue Jul 9, 2023 · 0 comments · Fixed by #7009
Labels

Comments

@RongtongJin
Copy link
Contributor

RongtongJin commented Jul 9, 2023

Before Creating the Bug Report

  • I found a bug, not just asking a question, which should be created in GitHub Discussions.

  • I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.

  • I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.

Runtime platform environment

Linux

RocketMQ version

develop branch

JDK Version

1.8

Describe the Bug

When both haproxy and tls protocols are enabled on the server at the same time, the received packet is first haproxy protocol, then tls protocol.

image

the ssl handshake uses the first byte to determine if it is the first package of tls handshake now. However, the read index is shifted due to the previous haproxy protocol parsing, so it needs to be changed to judge the first byte on the current read index.

image

Steps to Reproduce

  1. The server opens both haproxy and tls protocols at the same time.
  2. The client sends messages using tls.
  3. The message sending fails and the connection cannot be established.

What Did You Expect to See?

Message sending works normally.

What Did You See Instead?

Message sending fails.

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant