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

Get SslHandler by name for ALPN in HttpClientChannelInitializer #2488

Closed
wants to merge 2 commits into from

Conversation

j-bahr
Copy link
Contributor

@j-bahr j-bahr commented Sep 15, 2022

Switch to accessing the SslHandler by name in client ALPN. This should always return the SslHandler for remote endpoint. If we don't do this, the pipeline will always return the first SslHandler in the pipeline. When talking through a TLS enabled forward proxy there may be more than one SslHandler present in the pipeline. This change ensures that we always get the SslHandler for the remote HTTP endpoint and not an intermediary, ensuring we set the correct negotiated protocol.

Fixes #2480

Switch to accessing the SslHandler by name in client ALPN. This should always return the SslHandler for remote endpoint. If we don't do this, the pipeline will always return the first SslHandler in the pipeline. When talking through a TLS enabled forward proxy there may be more than one SslHandler present in the pipeline. This change ensures that we always get the SslHandler for the remote HTTP endpoint and not an intermediary, ensuring we set the correct negotiated protocol.

Fixes reactor#2480
@violetagg violetagg changed the base branch from main to 1.0.x September 15, 2022 09:00
@violetagg violetagg changed the base branch from 1.0.x to main September 15, 2022 09:00
@violetagg violetagg requested a review from a team September 15, 2022 10:10
@violetagg violetagg added the type/bug A general bug label Sep 15, 2022
@violetagg violetagg added this to the 1.0.24 milestone Sep 15, 2022
@violetagg
Copy link
Member

@reactor/netty-team PTAL

@violetagg
Copy link
Member

@reactor/netty-team The PR is targeting main branch. I will manually apply it to 1.0.x branch.

Copy link
Member

@pderop pderop left a comment

Choose a reason for hiding this comment

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

it looks good to me, thanks

violetagg pushed a commit that referenced this pull request Sep 15, 2022
Switch to accessing the SslHandler by name in client ALPN.
This should always return the SslHandler for remote endpoint.
If we don't do this, the pipeline will always return the first SslHandler in the pipeline.
When talking through a TLS enabled forward proxy there may be more than one SslHandler present in the pipeline.
This change ensures that we always get the SslHandler for the remote HTTP
endpoint and not an intermediary, ensuring we set the correct negotiated protocol.

Fixes #2480
violetagg added a commit that referenced this pull request Sep 15, 2022
violetagg added a commit that referenced this pull request Sep 15, 2022
@violetagg
Copy link
Member

@j-bahr Thanks for the PR.
I've merged the fix to 1.0.x branch (f8f9a3d) and then forward merged to main branch (2662ecc) and netty5 branch (a51c5b7)

@violetagg violetagg closed this Sep 15, 2022
@j-bahr j-bahr deleted the alpn-for-ssl-proxy branch September 15, 2022 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

H2OrHttp11Codec may cause ALPN to fail in HttpClient in certain circumstances
3 participants