-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
TLS support for HTTP API of Query server #2337
Conversation
Signed-off-by: rjs211 <srivatsa211@gmail.com>
Signed-off-by: rjs211 <srivatsa211@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @yurishkuro mentioned in Gitter, there's a bug in the current code, causing the flags to not be exposed. You'll need to add the following to the flags.go
, #AddFlags
method:
tlsGrpcFlagsConfig.AddFlags(flagSet)
tlsHttpFlagsConfig.AddFlags(flagSet)
Please, fix the naming of the properties and vars as well: gRPC should be always GRPC
and Http
should be HTTP
. Other than that, looks good to me.
We may want to hold on merging this before #2338 is sorted out. |
Signed-off-by: rjs211 <srivatsa211@gmail.com>
Signed-off-by: rjs211 <srivatsa211@gmail.com>
Please describe if/how you performed the real integration test that uses certificates. Would be nice to add those to the suite of integration tests in the CI. |
Signed-off-by: rjs211 <srivatsa211@gmail.com>
Signed-off-by: rjs211 <srivatsa211@gmail.com>
Signed-off-by: rjs211 <srivatsa211@gmail.com>
Signed-off-by: rjs211 <srivatsa211@gmail.com>
I used mkcert I think.
…On Mon, 13 Jul 2020, 04:27 Yuri Shkuro, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In cmd/query/app/server_test.go
<#2337 (comment)>:
> @@ -53,7 +53,20 @@ func TestCreateTLSServerError(t *testing.T) {
}
_, err := NewServer(zap.NewNop(), &querysvc.QueryService{},
- &QueryOptions{TLS: tlsCfg}, opentracing.NoopTracer{})
+ &QueryOptions{TLSGrpc: tlsCfg}, opentracing.NoopTracer{})
+ assert.NotNil(t, err)
+}
+
+func TestCreateTLSHttpServerError(t *testing.T) {
+ tlsCfg := tlscfg.Options{
+ Enabled: true,
+ CertPath: "invalid/path",
+ KeyPath: "invalid/path",
+ ClientCAPath: "invalid/path",
+ }
+
+ _, err := NewServer(zap.NewNop(), &querysvc.QueryService{},
I am not sure. We also have another set of test certificates under
./cmd/agent/app/reporter/grpc/testdata, and they are used for the actual
client/server test in TestProxyClientTLS --
./cmd/agent/app/reporter/grpc/builder_test.go.
@tcolgate <https://github.com/tcolgate> do you remember how you generated
those certificates? We should have documented it somewhere, either in
testdata/README or have a Makefile target.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2337 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAASR47VJOQPZVH6GYAKMPDR3J5IXANCNFSM4OVJWF2A>
.
|
Signed-off-by: rjs211 <srivatsa211@gmail.com>
Signed-off-by: rjs211 <srivatsa211@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #2337 +/- ##
==========================================
+ Coverage 95.73% 95.81% +0.08%
==========================================
Files 216 216
Lines 9593 9615 +22
==========================================
+ Hits 9184 9213 +29
+ Misses 336 332 -4
+ Partials 73 70 -3
Continue to review full report at Codecov.
|
Signed-off-by: rjs211 <srivatsa211@gmail.com>
Signed-off-by: rjs211 <srivatsa211@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'll leave it open for a day, to see if other maintainers want to review it as well.
@rjs211 are you still interested in working on this one? |
… dev-addTLS-rjs211
Signed-off-by: rjs211 <srivatsa211@gmail.com>
Signed-off-by: rjs211 <srivatsa211@gmail.com>
Pull request has been modified.
…into dev-addTLS-rjs211
@rjs211 Are you still working on this issue? |
I had finished this task and all the test cases had passed. I had received one approval and was waiting for a second one. I see now that in the meantime the branch is our of date with master. I'll start working on this again. |
Is this ready for a review? |
Yes. It is. There weren't any merge conflicts. Ready for review. |
I'll take another look tomorrow! Thanks for working on this one. |
Sorry, didn't have time to look into this yet, but should be able to look at this at most early next week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you like to give a final review, @yurishkuro ? From my perspective, this can be merged already.
@rjs211 thanks! Could you add another PR that describes these changes in the CHANGELOG? This change is not as straightforward as the PR title implies, due to the tricky handling of separate ports. |
Related to: * jaegertracing/jaeger#2337 * jaegertracing/jaeger#2297 Signed-off-by: Yuri Shkuro <github@ysh.us>
* Added TLS for HTTP (consumer-query) server Signed-off-by: rjs211 <srivatsa211@gmail.com> * Add testcase of error in TLS HTTP server creation Signed-off-by: rjs211 <srivatsa211@gmail.com> * Minor refactoring of properties and vars Signed-off-by: rjs211 <srivatsa211@gmail.com> * Exposing flags for HTTP and GRPC with TLS config Signed-off-by: rjs211 <srivatsa211@gmail.com> * minor refactoring of comments Signed-off-by: rjs211 <srivatsa211@gmail.com> * Changed TLS server to use tlsCfg instead of injection Signed-off-by: rjs211 <srivatsa211@gmail.com> * Create test for HTTP server with TLS and MTLS Signed-off-by: rjs211 <srivatsa211@gmail.com> * Removing checks to avoid race condition Signed-off-by: rjs211 <srivatsa211@gmail.com> * Adding testdata of certificates and keys of CA, server & client Signed-off-by: rjs211 <srivatsa211@gmail.com> * Changing the names of keys and certificates Signed-off-by: rjs211 <srivatsa211@gmail.com> * Coverage increase and cleanup Signed-off-by: rjs211 <srivatsa211@gmail.com> * removing redundant certif/keys set and using previously available set Signed-off-by: rjs211 <srivatsa211@gmail.com> * Added helper function to serve HTTP server Signed-off-by: rjs211 <srivatsa211@gmail.com> * Modify cmux and tests for secure HTTP and GRPC Signed-off-by: rjs211 <srivatsa211@gmail.com> * Fixing testscases for safe re-use Signed-off-by: rjs211 <srivatsa211@gmail.com> * Use common certificate flags for GRPC and HTTP Signed-off-by: rjs211 <srivatsa211@gmail.com> * Use common certificate flags for GRPC and HTTP Signed-off-by: rjs211 <srivatsa211@gmail.com> * tempCommit Signed-off-by: rjs211 <srivatsa211@gmail.com> * Using same tlsCfg structure for server Signed-off-by: rjs211 <srivatsa211@gmail.com> * Removing reduntant code, added comments, using correct port for testing Signed-off-by: rjs211 <srivatsa211@gmail.com> * modified test-cases for dedicated ports with TLS Signed-off-by: rjs211 <srivatsa211@gmail.com> * remove redundant test, created error var Signed-off-by: rjs211 <srivatsa211@gmail.com> * remove redundant test, created error var Signed-off-by: rjs211 <srivatsa211@gmail.com> * removed code repitition, added comment Signed-off-by: rjs211 <srivatsa211@gmail.com> * added table-based tests for QueryOptions port allocation Signed-off-by: rjs211 <srivatsa211@gmail.com>
@yurishkuro Hello, and apologies for delayed response. My personal laptop was under repair. I was looking at the entries in https://github.com/jaegertracing/jaeger/blob/master/CHANGELOG.md and they seem to be one liners without much detail. Could you please show me an example where some logic is explained? Would writing a documentation help? If so, could you please direct me to the correct place to write the same? Thanks. |
See, for example, the Breaking Changes section in https://github.com/jaegertracing/jaeger/blob/master/CHANGELOG.md#1200-2020-09-29 We don't need to explain the logic, but what is changing and how those changes affect users. |
Which problem is this PR solving?
Short description of the changes
Similar to PR TLS support for gRPC Query server #2297 .
independent TLS flags are exposed for gRPC and HTTP endpoints, enabling the user to provide different set of key, cert, CA-Cert , etc for each communication channal.
provides the option of enabling TLS/mTLS in none, either one or both of HTTP and gRPC endpoints.
forces the user to use dedicated HTTP and gRPC ports if TLS is enabled in any of the endpoints.