Skip to content

tls: move ssl connection info into SocketAddressProvider#17334

Merged
ggreenway merged 21 commits intoenvoyproxy:mainfrom
soulxu:move_ssl_info_2
Aug 4, 2021
Merged

tls: move ssl connection info into SocketAddressProvider#17334
ggreenway merged 21 commits intoenvoyproxy:mainfrom
soulxu:move_ssl_info_2

Conversation

@soulxu
Copy link
Member

@soulxu soulxu commented Jul 14, 2021

Commit Message: tls: move ssl connection info into SocketAddressProvider
Additional Description:
Moving the StreamInfo's SSL connection info into the SocketAddressProvider.
Risk Level: low
Testing: unittest
Docs Changes: n/a
Release Notes: n/a
Part of #17168

Signed-off-by: He Jie Xu hejie.xu@intel.com

soulxu added 5 commits July 12, 2021 06:22
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
@soulxu soulxu requested a review from lizan as a code owner July 14, 2021 07:56
@soulxu
Copy link
Member Author

soulxu commented Jul 14, 2021

cc @mattklein123

*/
virtual const SocketAddressProvider& addressProvider() const PURE;
virtual SocketAddressProviderSharedPtr addressProviderSharedPtr() const PURE;
virtual SocketAddressSetterSharedPtr addressProviderSharedPtr() const PURE;
Copy link
Member Author

Choose a reason for hiding this comment

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

note: I have to change this due to allow the StreamInfo to set the upstream SSL connection into the AddressProvider.

* @param connection_info sets the upstream ssl connection.
*/
virtual void
setUpstreamSslConnection(const Ssl::ConnectionInfoConstSharedPtr& ssl_connection_info) PURE;
Copy link
Member Author

@soulxu soulxu Jul 14, 2021

Choose a reason for hiding this comment

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

This was kept to avoid change the 'downstreamSslConnection()' interface as non const. I feel change the 'downstreamSslConnection' isn't right direction.

Also this is why I can change the place to set the upstream SSL connection

stream_info_.setUpstreamSslConnection(info.downstreamSslConnection());

soulxu added 3 commits July 15, 2021 05:37
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
@soulxu
Copy link
Member Author

soulxu commented Jul 19, 2021

/retest

@repokitteh-read-only
Copy link

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

🐱

Caused by: a #17334 (comment) was created by @soulxu.

see: more, trace.

Copy link
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.

/wait

* @return the upstream SSL connection. This will be nullptr if the upstream
* connection does not use SSL.
*/
virtual Ssl::ConnectionInfoConstSharedPtr upstreamSslConnection() const PURE;
Copy link
Member

Choose a reason for hiding this comment

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

I think this interface should only have the downstreamSslConnection(). All the other fields here are specific to the downstream connection, so including the upstream connection seems misleading.

Copy link
Member Author

@soulxu soulxu Jul 22, 2021

Choose a reason for hiding this comment

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

Yes, I feel strange too. Although we can keep this in the StreamInfo also, but it still feel strange, since the StreamInfo is only mean to stream for one direction(upstream, or downstream). Also can see the downstream StreamInfo's upstream SSL info is copied from upstream StreamInfo. For example:

getStreamInfo().setUpstreamSslConnection(ssl_info);

So in the end, the upstream SSL info is still mixed with downstream SSL info into downstream StreamInfo. Based on my guess the reason is the filter need the upstream StreamInfo, but other than tcpProxy or HttpRouter filter can't get the upstream StreamInfo, since the upstream StreamInfo is created the last filter (tcpProxy/http router filter).

Copy link
Member

Choose a reason for hiding this comment

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

The streaminfo is a bit odd, and has a mix of upstream/downstream. But SocketAddressProvider is only supposed to have information that should be copied to each request on the connection. The upstream ssl info should not be copied between requests, so I don't think it belongs here.

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks, got it, let me revert the change to upstream SSL info.

soulxu added 5 commits July 24, 2021 12:18
This reverts commit 2df315a.

Signed-off-by: He Jie Xu <hejie.xu@intel.com>
This reverts commit d04acbd.

Signed-off-by: He Jie Xu <hejie.xu@intel.com>
This reverts commit 3b56911.

Signed-off-by: He Jie Xu <hejie.xu@intel.com>
This reverts commit f9881a3.

Signed-off-by: He Jie Xu <hejie.xu@intel.com>
…ider"

This reverts commit 2dffc9f.

Signed-off-by: He Jie Xu <hejie.xu@intel.com>
soulxu added 5 commits July 25, 2021 00:22
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
@soulxu
Copy link
Member Author

soulxu commented Jul 26, 2021

/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 #17334 (comment) was created by @soulxu.

see: more, trace.

@soulxu
Copy link
Member Author

soulxu commented Jul 26, 2021

/retest

@repokitteh-read-only
Copy link

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

🐱

Caused by: a #17334 (comment) was created by @soulxu.

see: more, trace.

@soulxu
Copy link
Member Author

soulxu commented Jul 26, 2021

emm...I can't reproduce the ci failure

@ggreenway
Copy link
Member

Looks like the test timed out. Unsure why. Let's see if it's happier in CI today:

/retest

@repokitteh-read-only
Copy link

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

🐱

Caused by: a #17334 (comment) was created by @ggreenway.

see: more, trace.

@ggreenway
Copy link
Member

The last two guarddog tests are taking over 1 minute each, so the test is timing out. Unsure why. Can you try merging main into the PR to see if that helps?

@soulxu
Copy link
Member Author

soulxu commented Jul 29, 2021

The last two guarddog tests are taking over 1 minute each, so the test is timing out. Unsure why. Can you try merging main into the PR to see if that helps?

got it, thanks

Signed-off-by: He Jie Xu <hejie.xu@intel.com>
@ggreenway
Copy link
Member

@soulxu CI is fixed, but now's there a merge conflict; please resolve.

@ggreenway
Copy link
Member

/wait

Signed-off-by: He Jie Xu <hejie.xu@intel.com>
@soulxu
Copy link
Member Author

soulxu commented Aug 3, 2021

@soulxu CI is fixed, but now's there a merge conflict; please resolve.

resolved, thanks again!

@soulxu
Copy link
Member Author

soulxu commented Aug 3, 2021

emm....

https://dev.azure.com/cncf/envoy/_build/results?buildId=84261&view=logs&j=bbe4b42d-86e6-5e9c-8a0b-fea01d818a24&t=e00c5a13-c6dc-5e9a-6104-69976170e881&l=17863

Per-extension coverage failed:
Code coverage for source/common is lower than limit of 96.6 (96.5)
Code coverage for source/common/quic is lower than limit of 91.3 (91.2)

I will take a look at this tomorrow.

@ggreenway do you have any suggestions on fixing the coverage test, just add more tests?

@ggreenway
Copy link
Member

Looks like this should address the coverage issue. Merge from main to get it. Sorry for all the CI trouble on this PR. a066b5e

Signed-off-by: He Jie Xu <hejie.xu@intel.com>
@soulxu
Copy link
Member Author

soulxu commented Aug 4, 2021

/retest

@repokitteh-read-only
Copy link

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

🐱

Caused by: a #17334 (comment) was created by @soulxu.

see: more, trace.

@ggreenway
Copy link
Member

/retest

@repokitteh-read-only
Copy link

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

🐱

Caused by: a #17334 (comment) was created by @ggreenway.

see: more, trace.

@ggreenway
Copy link
Member

/retest

@repokitteh-read-only
Copy link

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

🐱

Caused by: a #17334 (comment) was created by @ggreenway.

see: more, trace.

@ggreenway ggreenway merged commit 371099f into envoyproxy:main Aug 4, 2021
baojr added a commit to baojr/envoy that referenced this pull request Aug 4, 2021
…bridge-stream

* upstream/main: (32 commits)
  tls: move ssl connection info into SocketAddressProvider (envoyproxy#17334)
  conn pool: default enable runtime feature `conn_pool_delete_when_idle` (envoyproxy#17577)
  api: LEDS api introduction (envoyproxy#17419)
  kafka: add support for api versions request in mesh-filter (envoyproxy#17475)
  ext_proc: Implement BUFFERED_PARTIAL processing mode (envoyproxy#17531)
  tooling: Async/pathlib/mypy cleanups and utils (envoyproxy#17505)
  xds: restructure CertificateProvider fields (envoyproxy#17201)
  Refactor OverloadIntegrationTest breaking out a test base, and the fake resource monitors. (envoyproxy#17530)
  listener: move active connection collection out of active tcp listener (envoyproxy#16947)
  tools: format checks for backticks (envoyproxy#17566)
  coverage: set lower limit for common/quic and common (envoyproxy#17573)
  v2: final source removal (envoyproxy#17565)
  test: bumping coverage (envoyproxy#17564)
  quic: enforcing header size and contents (envoyproxy#17520)
  Support for canonicalizing URI properly for AWS SigV4 signer (envoyproxy#17137)
  listener: add a stat for transport socket connect timeout (envoyproxy#17458)
  listener: add listen() error handling (envoyproxy#17427)
  http: return per route config when direct response is set (envoyproxy#17449)
  removing most v2 references from source/ (envoyproxy#17415)
  bug fix: return bootstrap when validating config (envoyproxy#17499)
  ...

Signed-off-by: Garrett Bourg <bourg@squareup.com>
leyao-daily pushed a commit to leyao-daily/envoy that referenced this pull request Sep 30, 2021
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.

2 participants