grpc: SSL credential support for Google gRPC client.#2598
grpc: SSL credential support for Google gRPC client.#2598htuch merged 5 commits intoenvoyproxy:masterfrom
Conversation
Risk Level: Low (not in use). Testing: new unit tests to validate SSL connections (and client certs) for all gRPC client types. Added SSL to ads_integration_test to validate end-to-end. Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
ggreenway
left a comment
There was a problem hiding this comment.
This looks good overall. Just one comment about the interface to DataSource.
source/common/config/datasource.h
Outdated
| // envoy::api::v2::core::DataSource helper. | ||
| class DataSource { | ||
| public: | ||
| DataSource(const envoy::api::v2::core::DataSource& source) : source_(source) {} |
There was a problem hiding this comment.
Given how this class is used, the API is a bit weird: every use constructs a temporary, calls one method, then destructs it. Instead, should we just have two static functions here, that both take a DataSource& ?
There was a problem hiding this comment.
I agree with Greg, this feels weird. Is there any reason those are not just namespaced functions that take source as a parameter, similarly to those in Envoy::Filesystem?
There was a problem hiding this comment.
Was assuming the compiler would be smart enough to optimize any overhead here away, since the class is entirely const/immutable everywhere, but sure, I can make it just some namespace functions if you folks prefer this convention.
Signed-off-by: Harvey Tuch <htuch@google.com>
|
@zuercher @ggreenway It looks like the Mac failure is genuine and probably related to this PR. I added SSL loopback for |
|
I think in circle-ci, as an envoy maintainer, you can tell it to re-run a job with ssh access. Can you attach a debugger in that context? |
|
@htuch it's stuck FakeHttpConnection::waitForNewStream: Which is the same as the other tests that periodically hang. Perhaps something about this test makes it hang more reliably. |
|
@zuercher I dug up an old MBA and managed to get Are there any quirks on OS X that came up when porting |
|
@lizan I think the issue here is that if the SSL handshake completes in the transport socket implementation at https://github.com/envoyproxy/envoy/blob/master/source/common/network/connection_impl.cc#L419, but there is pending write data, we never kick To confirm this is the issue, I added an |
|
I think in ConnectionImpl::raiseEvent(), add "if (event == connected && write buffer isn't empty) doWrite();" The socket will almost always be writable when the connected event is raised, and if it isn't, no harm is done (the write just won't accept any data). Also, we should add a test-case for this (write before connected; get's stuck). This seems like an existing bug, not just specific to this PR. |
|
@ggreenway That sounds reasonable. I'll do a separate PR for this. |
|
👍 |
When a handshake completed in transport socket doRead(), we didn't check to see if there were any pending bytes in the write buffer in Network::ConnectionImpl. This showed up in envoyproxy#2598, where ads_integration_test would hang while waiting for the server to connect to the fake management upstream. Risk Level: Medium (messing around with connection handshaking can do bad things). Testing: Additional unit test for ConnectionImpl changes. Validated ads_integration_test now passes on OS X. Signed-off-by: Harvey Tuch <htuch@google.com>
When a handshake completed in transport socket doRead(), we didn't check to see if there were any pending bytes in the write buffer in Network::ConnectionImpl. This showed up in #2598, where ads_integration_test would hang while waiting for the server to connect to the fake management upstream. Risk Level: Medium (messing around with connection handshaking can do bad things). Testing: Additional unit test for ConnectionImpl changes. Validated ads_integration_test now passes on OS X. Signed-off-by: Harvey Tuch <htuch@google.com>
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Signed-off-by: JP Simard <jp@jpsim.com>
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Signed-off-by: JP Simard <jp@jpsim.com>
Risk Level: Low (not in use).
Testing: new unit tests to validate SSL connections (and client certs) for all gRPC client types.
Added SSL to ads_integration_test to validate end-to-end.
Signed-off-by: Harvey Tuch htuch@google.com