Skip to content

conn pool: use hostnames of endpoints as SNI values#35380

Closed
dmitriyilin wants to merge 6 commits intoenvoyproxy:mainfrom
dmitriyilin:auto-sni-from-upstream
Closed

conn pool: use hostnames of endpoints as SNI values#35380
dmitriyilin wants to merge 6 commits intoenvoyproxy:mainfrom
dmitriyilin:auto-sni-from-upstream

Conversation

@dmitriyilin
Copy link
Copy Markdown
Contributor

Commit Message: conn pool: use hostnames of endpoints as SNI values
Additional Description: optional support for usage of upstream cluster endpoints' hostnames as SNI values. This PR is the successor of 34898 with expected improvement of test flakiness. Original PR was reverted by 35212.
Risk Level: Low
Testing: integration
Docs Changes: added information about new mechanism of SNI derivation
Release Notes: https://github.com/dmitriyilin/envoy/blob/0f70012a2383dd56cb070199664be44dbd8bbd93/changelogs/current.yaml#L16
Platform Specific Features: N/A
Fixes #15839

…nvoyproxy#34898)" (envoyproxy#35212)"

This reverts commit d84f707.

Signed-off-by: Dmitriy Ilin <dmitry.m.ilyin@gmail.com>
…o remove flakiness

Signed-off-by: Dmitriy Ilin <dmitry.m.ilyin@gmail.com>
@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @abeyad
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #35380 was opened by dmitriyilin.

see: more, trace.

Signed-off-by: Dmitriy Ilin <dmitry.m.ilyin@gmail.com>
@dmitriyilin
Copy link
Copy Markdown
Contributor Author

fyi, I took "ProxyFilterIntegrationTest, UpstreamTlsInvalidSAN" as basis for the test that was showing flaky behavior "AutoSniIntegrationTest, AutoSniFromUpstreamAndAutoSanValidationFailureTest".

Signed-off-by: Dmitriy Ilin <dmitry.m.ilyin@gmail.com>
Signed-off-by: Dmitriy Ilin <dmitry.m.ilyin@gmail.com>
Signed-off-by: Dmitriy Ilin <dmitry.m.ilyin@gmail.com>
@dmitriyilin
Copy link
Copy Markdown
Contributor Author

@adisuissa , could you "rereview" this change?

Copy link
Copy Markdown
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

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

/lgtm api

@adisuissa
Copy link
Copy Markdown
Contributor

Assigning Matt who also reviewed #34898. Can you provide more info about how the flaky test was fixed?
/assign @mattklein123

Copy link
Copy Markdown
Contributor

@yanavlasov yanavlasov left a comment

Choose a reason for hiding this comment

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

/wait

!upstream_http_protocol_options->auto_sni_from_upstream()) {
return transport_socket_options;
}
const absl::string_view hostname = host->hostname();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe host->hostname() can include :port if it was resolved by the Dynamic Forward Proxy. You can end up with invalid SNI.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

According to the comments hostname is a hostname and there is also address available in the HostDescription, so it would be very confusing to also include a port in hostname. I also can not spot where a port can be added to a hostname of a HostImpl or a LogicalHost.

@dmitriyilin
Copy link
Copy Markdown
Contributor Author

Assigning Matt who also reviewed #34898. Can you provide more info about how the flaky test was fixed? /assign @mattklein123

I had used ProxyFilterIntegrationTest. UpstreamTlsInvalidSAN test as the basis and added missed configuration:
FakeUpstream.setReadDisableOnNewConnection(false)

As flaky test validates behaviour in case of failure, I've added explicit cleanup:
HttpIntegrationTest.cleanupUpstreamAndDownstream()

@abeyad abeyad assigned adisuissa and unassigned abeyad Jul 29, 2024
@dmitriyilin
Copy link
Copy Markdown
Contributor Author

@yanavlasov, @adisuissa, @mattklein123, just a reminder

@quantumsheep
Copy link
Copy Markdown
Contributor

Hey! This is exactly the feature I'm needing. Do you think it's possible to do the same using current Envoy's release configuration?

@dmitriyilin
Copy link
Copy Markdown
Contributor Author

Hey! This is exactly the feature I'm needing. Do you think it's possible to do the same using current Envoy's release configuration?

It's a new functionality, so new config is needed.

@dmitriyilin
Copy link
Copy Markdown
Contributor Author

@yanavlasov, @adisuissa, @mattklein123 up

@github-actions
Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions Bot added the stale stalebot believes this issue/PR has not been touched recently label Oct 16, 2024
@dmitriyilin
Copy link
Copy Markdown
Contributor Author

@yanavlasov, @adisuissa, @mattklein123 do you see any issues with the changes?

@github-actions github-actions Bot removed the stale stalebot believes this issue/PR has not been touched recently label Oct 17, 2024
@dmitriyilin
Copy link
Copy Markdown
Contributor Author

@mattklein123 @yanavlasov @adisuissa any feedback?

@quantumsheep
Copy link
Copy Markdown
Contributor

I too would like this to be merged

@mattklein123
Copy link
Copy Markdown
Member

Can you please merge main and I can take a look?

/wait

Copy link
Copy Markdown
Member

@ggreenway ggreenway left a comment

Choose a reason for hiding this comment

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

I didn't see this PR and didn't know it existed. I implemented roughly the same thing in #36903, which merged last week.

@dmitriyilin
Copy link
Copy Markdown
Contributor Author

@ggreenway , thanks for the info. I am closing this PR then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support using each individual upstream's endpoint hostname as SNI parameter

8 participants