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 TLS to the NIO implementation #406

Merged
merged 5 commits into from
Mar 20, 2019
Merged

Add TLS to the NIO implementation #406

merged 5 commits into from
Mar 20, 2019

Conversation

glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Mar 19, 2019

  • Tests to follow in a separate PR
  • Certificate and key from Echo have been updated since the certificate had expired
  • EchoNIO uses the same certificate and key
  • Also adds diagram to explain the server pipeline


/// Wrapper object to manage the lifecycle of a gRPC server.
///
/// The pipeline is configured in three stages detailed below. Note: handlers marked with
/// a '*' are responsible for handling errors.
Copy link
Contributor

Choose a reason for hiding this comment

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

💜 the ascii art

@glbrntt
Copy link
Collaborator Author

glbrntt commented Mar 19, 2019

I also submitted a PR against master with the updated Echo certificate and key (#407)

Copy link
Collaborator

@MrMage MrMage left a comment

Choose a reason for hiding this comment

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

Great work, especially the flow chart! I do wonder, though, if we should provide a more convenient way of setting up "vanilla" SSL, especially on the client (see the gRPC-Core implementation, where you'd essentially just need to add , secure: true). Happy to have that in a later PR, though.

When you add tests in a follow-up PR, consider doing it similar to the gRPC-Core implementation, where we essentially run all tests a second time with SSL enabled.

@@ -29,11 +31,33 @@ let messageOption = Option("message",
default: "Testing 1 2 3",
description: "message to send")

func makeClientTLSConfiguration() throws -> TLSConfiguration {
let certificate = try NIOSSLCertificate(file: "ssl.crt", format: .pem)
// The certificate common name is "example.com", so skip verification.
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: mind inserting "hostname" after "skip"?

@glbrntt
Copy link
Collaborator Author

glbrntt commented Mar 19, 2019

Great work, especially the flow chart! I do wonder, though, if we should provide a more convenient way of setting up "vanilla" SSL, especially on the client (see the gRPC-Core implementation, where you'd essentially just need to add , secure: true). Happy to have that in a later PR, though.

That's a good point. It's worth adding now since it should be fairly straightforward.

When you add tests in a follow-up PR, consider doing it similar to the gRPC-Core implementation, where we essentially run all tests a second time with SSL enabled.

Exactly what I had in mind ;)

Copy link
Collaborator

@MrMage MrMage left a comment

Choose a reason for hiding this comment

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

LGTM; I'd appreciate if @rebello95 could also take a look before merging.

@rebello95
Copy link
Collaborator

@MrMage I trust your review - I'm not very familiar with the NIO implementation 😄

@MrMage MrMage merged commit 5cdda76 into grpc:nio Mar 20, 2019
@glbrntt glbrntt deleted the tls branch June 11, 2019 13:09
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.

4 participants