Skip to content
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 connector that allows self-signed certs #2273

Open
wants to merge 4 commits into
base: mvtx-adapt
Choose a base branch
from

Conversation

BulkBeing
Copy link
Contributor

@BulkBeing BulkBeing commented Dec 11, 2024

This approach works on Mac with Golang gRPC server listening on https (self-signed certs). But it failing in k8s with below error:

2024-12-11T15:33:23.693266Z  INFO numaflow_core::metrics: Connecting to Monovertex daemon uri=https://10.96.76.169:4327/
thread 'tokio-runtime-worker' panicked at /numaflow/numaflow-core/src/metrics.rs:896:14:
daemon should be up: Status { code: Unknown, message: "client error (UserUnsupportedVersion)", source: Some(hyper_util::client::legacy::Error(UserUnsupportedVersion)) }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2024-12-11T15:33:23.693934Z  WARN hyper_util::client::legacy::client: Connection is HTTP/1, but request requires HTTP/2

This may be because of ALPN seanmonstar/reqwest#2350 (comment)
However, the unit tests shows ALPN protocols are set when we use enable_http2() method.

It seems hyper's client pool is http1 and tonic is trying to send http2 request https://docs.rs/hyper-util/0.1.10/src/hyper_util/client/legacy/client.rs.html#289

UPDATE:
This was because of golang/go#46602 and golang/go#14619

@BulkBeing BulkBeing marked this pull request as ready for review December 13, 2024 03:33
}

cer, err := sharedtls.GenerateX509KeyPair()
if err != nil {
return fmt.Errorf("failed to generate cert: %w", err)
}

tlsConfig := &tls.Config{Certificates: []tls.Certificate{*cer}, MinVersion: tls.VersionTLS12}
tlsConfig := &tls.Config{Certificates: []tls.Certificate{*cer}, MinVersion: tls.VersionTLS12, NextProtos: []string{"h2", "http/1.1"}}
Copy link
Member

Choose a reason for hiding this comment

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

do not make this change.

Copy link
Member

Choose a reason for hiding this comment

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

i am moving this PR to draft state.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

do not make this change.

Removed.

@vigith vigith marked this pull request as draft December 13, 2024 05:26
Signed-off-by: Sreekanth <[email protected]>
@BulkBeing
Copy link
Contributor Author

When we specifytls.Config.NextProtos = []string{"h2", "http/1.1"}, kubelet's health check tries to do health check probes with HTTP/2 request. The cmux we use thinks it is a gRPC request and results in 415 Unsupported content type. Since it breaks the k8s health checks, we won't be making this change.

Currently, this PR would only be adding a utility hyper client for future use with gRPC servers that use self-signed certs.

@BulkBeing BulkBeing marked this pull request as ready for review December 13, 2024 06:19
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