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

fixing erroneous direct construction of Netty3Listener without params in finagle-thrift #412

Closed
wants to merge 1 commit into from
Closed

fixing erroneous direct construction of Netty3Listener without params in finagle-thrift #412

wants to merge 1 commit into from

Conversation

danielpcox
Copy link
Contributor

Greetings Finagle masters,

TL;DR In finagle-thrift (and none of the other protocol libraries), Netty3Listener was being constructed directly, without passing in the params.

I was originally trying to test the official solution to #175 and was able to get TLS over Thrift and extraction of the client certificate working using the old builder API, but not with the new Finagle 6 API. Eventually I discovered that apply on the Netty3Listener object was never being called, which led to this adjustment.

@mosesn and I discussed the removal of the hard-coded "thrift" label, and since it's only used as a backup scope for the stats receiver if the ServerRegistry doesn't have one for the listening address, and because it's manually configurable by the user, it seemed safe to remove it. I think it was probably only put there anyway because direct use of the constructor requires it.

Thanks to @mosesn @jeremyrsmith for helping me run this to ground.

@mosesn
Copy link
Contributor

mosesn commented Sep 3, 2015

Have you tested this to make sure it solves the problem?

@danielpcox
Copy link
Contributor Author

I will be today. Just have to figure out how to build Finagle first. :)

@danielpcox
Copy link
Contributor Author

Yes. Hallelujah. I can confirm that this fix allows me to use the new Finagle 6 APIs to

a) do Thrift RPC over TLS and
b) extract the client certificate from the Transport to allow for PKI-based client authentication.

Examples of these miracles are here: https://github.com/DecipherNow/finagle-tls/tree/new-api
Obviously at the moment they require a manual publishM2 of this finagle-thrift fork to use.

@mosesn
Copy link
Contributor

mosesn commented Sep 3, 2015

👍 shipit

@nshkrob
Copy link
Contributor

nshkrob commented Sep 8, 2015

Makes sense. Can you add a simple unit test, e.g. by setting the Stats param and checking for stats?

@danielpcox
Copy link
Contributor Author

Sure, though it's crunch-time on another project so it'll have to wait until Monday.

@suls
Copy link
Contributor

suls commented Sep 8, 2015

I verified this with https://groups.google.com/forum/#!topic/finaglers/g_4i1xpfAJo ..

Would adding a thrift/TLS test case be overkill?

@mosesn
Copy link
Contributor

mosesn commented Sep 8, 2015

Nah, seems reasonable. Do you want to make a PR against Daniel's branch? The one caveat is that because we're going to squash this into one commit, only he would get the authorship credit for the change.

@nshkrob
Copy link
Contributor

nshkrob commented Sep 8, 2015

It would be definitely useful as a reference and as a test for this, thanks! @mosesn we can pull the test separately I think.

@mosesn
Copy link
Contributor

mosesn commented Sep 8, 2015

👍

@mariusae mariusae closed this in 53d69f3 Sep 10, 2015
mariusae pushed a commit that referenced this pull request Sep 21, 2015
Problem

PR #412 fixed the netty-pipeline for Thrift but didn't add a test.

Solution

Added end-to-end test-case for Thrift/TLS for stack based client and
server.

Result

Green ;)

Signed-off-by: Kevin Oliver <koliver@twitter.com>

RB_ID=743938
jbripley pushed a commit to jbripley/finagle that referenced this pull request Oct 28, 2015
Problem

Thrift Servers construct a Netty3Listener using just the pipeline and a
hardcoded name, ignoring the params.

Solution

Use the newer constructor that takes a pipeline and params.

Signed-off-by: Neuman Vong <nvong@twitter.com>
Github: Closes twitter#412

RB_ID=739586
jbripley pushed a commit to jbripley/finagle that referenced this pull request Oct 28, 2015
Problem

PR twitter#412 fixed the netty-pipeline for Thrift but didn't add a test.

Solution

Added end-to-end test-case for Thrift/TLS for stack based client and
server.

Result

Green ;)

Signed-off-by: Kevin Oliver <koliver@twitter.com>

RB_ID=743938
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants