Skip to content

transport sockets: split downstream and upstream transport socket factory#21648

Merged
lizan merged 13 commits intoenvoyproxy:mainfrom
kyessenov:upstream_downstream_transport_socket
Jun 15, 2022
Merged

transport sockets: split downstream and upstream transport socket factory#21648
lizan merged 13 commits intoenvoyproxy:mainfrom
kyessenov:upstream_downstream_transport_socket

Conversation

@kyessenov
Copy link
Contributor

Signed-off-by: Kuat Yessenov kuat@google.com

Description: Addresses the unfortunate pattern of using createTransportSocket(nullptr) to indicate a downstream transport socket, by making the two interfaces explicit. In theory, this should permit adding more context to the calls (such as host for upstream).
Description:
Risk Level: low, refactor
Testing: WIP
Docs Changes: none
Release Notes: none

/assign @lizan

Signed-off-by: Kuat Yessenov <kuat@google.com>
@repokitteh-read-only
Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #21648 was opened by kyessenov.

see: more, trace.

Signed-off-by: Kuat Yessenov <kuat@google.com>
@kyessenov kyessenov marked this pull request as ready for review June 9, 2022 22:50
Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
@kyessenov kyessenov requested a review from KBaichoo as a code owner June 10, 2022 17:02
Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
virtual void initialize() PURE;

// Network::TransportSocketFactory
// Network::UpstreamTransportSocketFactory
Copy link
Member

Choose a reason for hiding this comment

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

move this to QuicClientTransportSocketFactory?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
lizan
lizan previously approved these changes Jun 10, 2022
@kyessenov
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #21648 (comment) was created by @kyessenov.

see: more, trace.

Signed-off-by: Kuat Yessenov <kuat@google.com>
This reverts commit 87fa464.

Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
@kyessenov
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Check envoy-presubmit isn't fully completed, but will still attempt retrying.
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #21648 (comment) was created by @kyessenov.

see: more, trace.

Signed-off-by: Kuat Yessenov <kuat@google.com>
@kyessenov
Copy link
Contributor Author

@lizan Could you re-approve? Added just one more test to recover coverage.

@lizan lizan merged commit bfc2cc2 into envoyproxy:main Jun 15, 2022
jpsim added a commit to envoyproxy/envoy-mobile that referenced this pull request Jun 16, 2022
Signed-off-by: JP Simard <jp@jpsim.com>
}
stream_info->setFilterChainName(filter_chain->name());
auto transport_socket = filter_chain->transportSocketFactory().createTransportSocket(nullptr);
auto transport_socket = filter_chain->transportSocketFactory().createDownstreamTransportSocket();
Copy link
Contributor

@danzh2010 danzh2010 Jun 23, 2022

Choose a reason for hiding this comment

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

The intention of this PR is to split createTransportSocket() into client method and server method. But is it intentional that the transport socket option param is removed from the server transport socket creation interface? We don't have config knob for server transport socket options right now, but if we want to do mutual TLS and server transport socket will need to verify cert, would server transport socket also take some transport socket options?

cc @yanavlasov

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Socket options mostly serve as a way to create multiple upstream transport sockets for distinct groups of downstream requests, one per each variation. It's not about configuring the transport socket itself, that's done through the factory.

Copy link
Contributor

Choose a reason for hiding this comment

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

TransportSocketOptions::verifySubjectAltNameListOverride() is used in cert verification:

? transport_socket_options->verifySubjectAltNameListOverride()

Could this be used by the server to match SAN values in a client cert? Or allowing per-connection override is non-sense? @RyanTheOptimist

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the listener filter chain match is used to match SAN values. I can imagine a more flexible transport socket that can adapt during negotiation, but Envoy doesn't have that yet.

Amila-Rukshan pushed a commit to Amila-Rukshan/envoy that referenced this pull request Jun 28, 2022
…tory (envoyproxy#21648)

Addresses the unfortunate pattern of using `createTransportSocket(nullptr)` to indicate a downstream transport socket, by making the two interfaces explicit. In theory, this should permit adding more context to the calls (such as host for upstream).
Description:
Risk Level: low, refactor
Testing: WIP
Docs Changes: none
Release Notes: none

Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Amila Senadheera <amila.15@cse.mrt.ac.lk>
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