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

Does not work with tonic feature "tls-roots" #35

Closed
shelbyd opened this issue Sep 22, 2023 · 3 comments · Fixed by #36
Closed

Does not work with tonic feature "tls-roots" #35

shelbyd opened this issue Sep 22, 2023 · 3 comments · Fixed by #36

Comments

@shelbyd
Copy link

shelbyd commented Sep 22, 2023

I get the following error when enabling the "tls-roots" feature of tonic. Specifically when running the bigtable example.

Error: BuildError(tonic::transport::Error(Transport, hyper::Error(Connect, Custom { kind: InvalidData, error: InvalidMessage(InvalidContentType) })))

My guess is some kind of handshake issue with TLS. It's entirely possible that this is an issue with some dependency, but I can only really tell the issue from my interaction with this crate.

@rnarubin
Copy link
Collaborator

rnarubin commented Sep 22, 2023

Can you try using the tls-webpki-roots feature on tonic? it's possible our dep declarations aren't specific enough with the features

@shelbyd
Copy link
Author

shelbyd commented Sep 26, 2023

Still fails the same way with tls-webpki-roots.

rnarubin added a commit to rnarubin/ya-gcp that referenced this issue Nov 30, 2023
Previously the library attempted to abstract over different HTTP(s)
connectors by passing them as generics through various types. Although
this allows certain flexibility (e.g. choosing openssl vs rustls), it
was probably the wrong abstraction layer in the first place.

This change moves most of the genericism to the grpc-service layer for
grpc services (bigtable and pubsub). The library's "common" path via
builders will provide a sensible default implementation, but it will now
be possible to substitute the entire tower::service stack provided to
the grpc API. This is more flexible than the prior connector
abstraction, but also harder to use (you basically have to build
everything yourself). This feels like the right balance between a
batteries-included default and a build-your-own option.

Along the way I've also made some updates to non-exhaustivity in
generated code, to help ease future changes without breaking semver.
This is unfortunately less ergonomic, but not _too_ bad. Future changes
may include some builder pattern to make protobuf construction easier.

The GCS API is still largely the same, however it is still not in an
ideal place. Future changes may bring it more towards service
abstraction.

Supersedes standard-ai#30
Fixes standard-ai#35
rnarubin added a commit to rnarubin/ya-gcp that referenced this issue Nov 30, 2023
Previously the library attempted to abstract over different HTTP(s)
connectors by passing them as generics through various types. Although
this allows certain flexibility (e.g. choosing openssl vs rustls), it
was probably the wrong abstraction layer in the first place.

This change moves most of the genericism to the grpc-service layer for
grpc services (bigtable and pubsub). The library's "common" path via
builders will provide a sensible default implementation, but it will now
be possible to substitute the entire tower::service stack provided to
the grpc API. This is more flexible than the prior connector
abstraction, but also harder to use (you basically have to build
everything yourself). This feels like the right balance between a
batteries-included default and a build-your-own option.

Along the way I've also made some updates to non-exhaustivity in
generated code, to help ease future changes without breaking semver.
This is unfortunately less ergonomic, but not _too_ bad. Future changes
may include some builder pattern to make protobuf construction easier.

The GCS API is still largely the same, however it is still not in an
ideal place. Future changes may bring it more towards service
abstraction.

Finally, this change includes updates to tonic and prost, bringing them
up to the latest versions.

Supersedes standard-ai#30
Fixes standard-ai#35
@rnarubin
Copy link
Collaborator

I've figured out the issue. ya-gcp constructs its own https connector, and passes this to tonic. However if tonic has tls enabled, it wraps the connector in its own https handler, and the two conflict. I've fixed this in #36

rnarubin added a commit that referenced this issue Dec 1, 2023
* Separate services from connectors

Previously the library attempted to abstract over different HTTP(s)
connectors by passing them as generics through various types. Although
this allows certain flexibility (e.g. choosing openssl vs rustls), it
was probably the wrong abstraction layer in the first place.

This change moves most of the genericism to the grpc-service layer for
grpc services (bigtable and pubsub). The library's "common" path via
builders will provide a sensible default implementation, but it will now
be possible to substitute the entire tower::service stack provided to
the grpc API. This is more flexible than the prior connector
abstraction, but also harder to use (you basically have to build
everything yourself). This feels like the right balance between a
batteries-included default and a build-your-own option.

Along the way I've also made some updates to non-exhaustivity in
generated code, to help ease future changes without breaking semver.
This is unfortunately less ergonomic, but not _too_ bad. Future changes
may include some builder pattern to make protobuf construction easier.

The GCS API is still largely the same, however it is still not in an
ideal place. Future changes may bring it more towards service
abstraction.

Finally, this change includes updates to tonic and prost, bringing them
up to the latest versions.

Supersedes #30
Fixes #35
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 a pull request may close this issue.

2 participants