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

Fix H2 Server with SNI bug #1665

Merged
merged 6 commits into from
Jul 15, 2021
Merged

Fix H2 Server with SNI bug #1665

merged 6 commits into from
Jul 15, 2021

Conversation

Scottmitch
Copy link
Member

Motivation:
H2 server with SNI enabled current does not work. Netty's SniHandler
does not queue writes in the same way that the SslHandler does. The h2
handler is added and writes a settings frame immediately on the server,
which is written to the socket before the handshake is completed. This
results in a handshake failure.

Modifications:

  • Defer adding h2 protocol handlers to the pipeline until after the SNI
    selection is made.

Result:
H2 Server with SNI now works as expected.

Motivation:
H2 server with SNI enabled current does not work. Netty's SniHandler
does not queue writes in the same way that the SslHandler does. The h2
handler is added and writes a settings frame immediately on the server,
which is written to the socket before the handshake is completed. This
results in a handshake failure.

Modifications:
- Defer adding h2 protocol handlers to the pipeline until after the SNI
  selection is made.

Result:
H2 Server with SNI now works as expected.
@Scottmitch
Copy link
Member Author

test failure attributed to #1663

Copy link
Member

@idelpivnitskiy idelpivnitskiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approach LGTM!
Only minor suggestions and a few questions:

@Scottmitch
Copy link
Member Author

build failure attributed to #1507

@Scottmitch Scottmitch merged commit 3dd8f13 into apple:main Jul 15, 2021
@Scottmitch Scottmitch deleted the h2_sni branch July 15, 2021 05:08
Scottmitch added a commit that referenced this pull request Jul 15, 2021
Motivation:
H2 server with SNI enabled current does not work. Netty's SniHandler
does not queue writes in the same way that the SslHandler does. The h2
handler is added and writes a settings frame immediately on the server,
which is written to the socket before the handshake is completed. This
results in a handshake failure.

Modifications:
- Defer adding h2 protocol handlers to the pipeline until after the SNI
  selection is made.

Result:
H2 Server with SNI now works as expected.
@Scottmitch
Copy link
Member Author

0.41 (05a1cc5)

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

Successfully merging this pull request may close these issues.

3 participants