Skip to content

Initial support for TLS#247

Merged
PureWhiteWu merged 34 commits intocloudwego:mainfrom
minghuaw:tls
Oct 27, 2023
Merged

Initial support for TLS#247
PureWhiteWu merged 34 commits intocloudwego:mainfrom
minghuaw:tls

Conversation

@minghuaw
Copy link
Copy Markdown
Contributor

@minghuaw minghuaw commented Oct 25, 2023

An initial attempt to add TLS support for gRPC.

Motivation

#6

Solution

Two new features flags are added "rustls" and "native-tls" so that user can choose the preferred TLS implementation in the community. A new client/server example that uses "rustls" is added to showcase the usage.

Additionally, Cargo.lock is removed from the tracked files in git.

@minghuaw minghuaw requested review from a team as code owners October 25, 2023 09:42
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Oct 25, 2023

CLA assistant check
All committers have signed the CLA.

@PureWhiteWu
Copy link
Copy Markdown
Contributor

Wow! This is a really great pr to implement an important feature! Thanks very much for your contribution!

@PureWhiteWu PureWhiteWu added A-volo-grpc This issue concerns the `volo-grpc` crate. C-enhancement This is a PR that adds a new feature or fixes a bug. labels Oct 26, 2023
Comment thread examples/src/hello_grpc_tls/grpc_tls_client.rs Outdated
Comment thread examples/Cargo.toml Outdated
Comment thread examples/src/hello_grpc_tls/grpc_tls_server.rs Outdated
Comment thread volo-grpc/Cargo.toml Outdated
Comment thread volo-grpc/src/lib.rs Outdated
Comment thread volo/Cargo.toml Outdated
Comment thread volo/src/net/dial.rs
Comment thread volo/src/net/dial.rs Outdated
Comment thread volo/src/net/dial.rs Outdated
Comment thread volo/src/net/dial.rs Outdated
@PureWhiteWu
Copy link
Copy Markdown
Contributor

Furthermore, I think we should still preserve the Cargo.lock, this is useful for cooperation, because everyone maintaining this project can have the same build environment and reproduce the build.

@minghuaw
Copy link
Copy Markdown
Contributor Author

Furthermore, I think we should still preserve the Cargo.lock, this is useful for cooperation, because everyone maintaining this project can have the same build environment and reproduce the build.

I doubt this though. I personally do not remember other open source library crates doing the same thing. Plus, I have just looked through a few closed PRs, and seems like Cargo.lock appear quite frequently in the PRs. That doesn't sounds like it's "keeping the same build environment".

@minghuaw
Copy link
Copy Markdown
Contributor Author

minghuaw commented Oct 26, 2023

Which version of pilota and motore should be used? Trying to compile the examples but getting errors that afit and rpitit are not enabled in those two crates

Edit: Nvm, updated my nightly toolchain and this problem is gone. Should there be a minimum toolchain version somewhere though?

@PureWhiteWu
Copy link
Copy Markdown
Contributor

I doubt this though. I personally do not remember other open source library crates doing the same thing. Plus, I have just looked through a few closed PRs, and seems like Cargo.lock appear quite frequently in the PRs. That doesn't sounds like it's "keeping the same build environment".

In fact, we have tried to remove the Cargo.lock before, but we encountered some problems, such as I have updated the dependency in my dev environment, but other people didn't, so after they pull the code, they will encounter compile failure, and may lead to extra communication cost.

@PureWhiteWu
Copy link
Copy Markdown
Contributor

Should there be a minimum toolchain version somewhere though?

We are supposed to have a MSRV of 1.75 in the future. But for now, we recommend to use the latest nightly.

@minghuaw
Copy link
Copy Markdown
Contributor Author

I doubt this though. I personally do not remember other open source library crates doing the same thing. Plus, I have just looked through a few closed PRs, and seems like Cargo.lock appear quite frequently in the PRs. That doesn't sounds like it's "keeping the same build environment".

In fact, we have tried to remove the Cargo.lock before, but we encountered some problems, such as I have updated the dependency in my dev environment, but other people didn't, so after they pull the code, they will encounter compile failure, and may lead to extra communication cost.

I still think there are better ways to get around this, but if that's really troubling for you, I am fine with tracking Cargo.lock with git (fixed in 6b9c8d5).

Comment thread volo-grpc/src/cfg.rs
Copy link
Copy Markdown
Contributor

@PureWhiteWu PureWhiteWu left a comment

Choose a reason for hiding this comment

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

LGTM,Thanks for your contribution!
@bobozhengsir @Millione PTAL

@PureWhiteWu PureWhiteWu merged commit 4981534 into cloudwego:main Oct 27, 2023
@PureWhiteWu
Copy link
Copy Markdown
Contributor

Thanks again for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-volo-grpc This issue concerns the `volo-grpc` crate. C-enhancement This is a PR that adds a new feature or fixes a bug.

Development

Successfully merging this pull request may close these issues.

4 participants