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

Add warning for TLS #609

Merged

Conversation

chrisstaite-menlo
Copy link
Collaborator

@chrisstaite-menlo chrisstaite-menlo commented Jan 17, 2024

Description

Tonic has changed its behaviour such that the TLS configuration is ignored within transport/service/connector.rs if the scheme isn't https. Firstly, add support for grpcs scheme by swapping it out in the endpoint Uri if set. Secondly, add a warning to the unsuspecting user that sets the TLS configuration, but not the correct scheme.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

I spent a long time trying to figure out why my TLS configuration wasn't working with the Tonic upgrade to 0.10.

Checklist

  • Updated documentation if needed
  • Tests added/amended
  • bazel test //... passes locally
  • PR is contained in a single commit, using git amend see some docs

This change is Reviewable

Copy link

vercel bot commented Jan 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nativelink-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 18, 2024 5:20pm

Copy link
Member

@allada allada left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 LGTMs obtained


nativelink-util/src/tls_utils.rs line 75 at r1 (raw file):

        };
        if endpoint.scheme_str() != Some("https") {
            tracing::warn!("You have set TLS configuration on {endpoint}, these will be ignored because the scheme is insecure.  Set to https or grpcs.");

I'm thinking maybe we should not allow TLS to be configured if "https" is not used. What do you think about returning an error here instead?

It looks like all places that use this function are all on construction, so in theory the program would just not start.

@chrisstaite-menlo
Copy link
Collaborator Author

nativelink-util/src/tls_utils.rs line 75 at r1 (raw file):

Previously, allada (Nathan (Blaise) Bruer) wrote…

I'm thinking maybe we should not allow TLS to be configured if "https" is not used. What do you think about returning an error here instead?

It looks like all places that use this function are all on construction, so in theory the program would just not start.

I considered an error, but couldn't decide. Happy to go either way.

Copy link
Member

@allada allada left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 LGTMs obtained


nativelink-util/src/tls_utils.rs line 75 at r1 (raw file):

Previously, chrisstaite-menlo (Chris Staite) wrote…

I considered an error, but couldn't decide. Happy to go either way.

Yeah lets do an error. Devs will have a higher chance of reading stderr/out if it crashes than at runtime.

Copy link
Member

@adam-singer adam-singer left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: 0 of 1 LGTMs obtained

Copy link
Collaborator Author

@chrisstaite-menlo chrisstaite-menlo left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 LGTMs obtained, and pending CI: Vercel, pre-commit-checks


nativelink-util/src/tls_utils.rs line 75 at r1 (raw file):

Previously, allada (Nathan (Blaise) Bruer) wrote…

Yeah lets do an error. Devs will have a higher chance of reading stderr/out if it crashes than at runtime.

Done.

Tonic has changed its behaviour such that the TLS configuration is ignored
within transport/service/connector.rs if the scheme isn't https.  Firstly,
add support for grpcs scheme by swapping it out in the endpoint Uri if set.
Secondly, add a warning to the unsuspecting user that sets the TLS
configuration, but not the correct scheme.
Copy link
Member

@allada allada left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: 1 of 1 LGTMs obtained, and pending CI: Remote / large-ubuntu-22.04

Copy link
Member

@adam-singer adam-singer left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed all commit messages.
Reviewable status: :shipit: complete! 2 of 1 LGTMs obtained

@chrisstaite-menlo chrisstaite-menlo merged commit 63e2ad6 into TraceMachina:main Jan 19, 2024
22 checks passed
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.

None yet

3 participants