-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
gRPC with TLS doesn't work with cmux in mixed mode #2338
Comments
I think the Example (RecursiveCmux) from here can easily suit our needs. Basically, create any non-tls handers (if there is any) in the first cmux. If not satisfied, assume it is TLS and use a tls listener as the input listener of the inner cmux with tls enabled servers. We would need to build the cmux dynamically with some factory method based on whether which of gRPC and / or HTTP tls is enabled. but one major pitfall would be that we can use only one common pair of certificates for both gRPC and HTTP. |
Do you want to try? |
Yes. Will try this first. |
I think #2337 Solves this one as well now. Used only one cmux.
|
Then we should have only one set of flags. I can't see a way to have both gRPC and HTTP under one single port, each with its own cert... |
Should be fixed now. |
This causes another problem. There can be only one ClientCA for both GRPC and HTTP server. But they might very well get their client-certificates from two different CAs. Can i change the |
Aah, one certificate file would contain multiple certificates. We dont ahve to do that. |
it may be worth mentioning this in the corresponding TLS config option. |
@rjs211 I think you fixed this one already, haven't you? |
@jpkrohling Yes. This should be fixed when #2387 is merged. |
Just to clarify, This is solved (i.e. a working solution) only when the user descides to use two separate ports. i.e. when query.host-port is not defined and at least one of query.grpc-server.host-port or query.http-server.host-port is defined. This actual feature would be a part if #2337. I am resuming working on that now. |
Describe the bug
I faced open-telemetry/opentelemetry-collector#1227 some time ago, and while reviewing #2337, I noticed that we have the same pattern in Jaeger:
jaeger/cmd/query/app/server.go
Lines 138 to 145 in 02d4567
Basically, when gRPC is behind TLS,
cmux
can't determine the headers before doing the TLS handshake, and the TLS handshake happens at the gRPC layer. The end result is that all calls end up going to the HTTP handler when a client is attempting to establish a gRPC TLS connection.To Reproduce
Steps to reproduce the behavior:
A possible solution is mentioned here in a follow-up issue at OpenTelemetry Collector: open-telemetry/opentelemetry-collector#1256 (comment)
The text was updated successfully, but these errors were encountered: