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

nsqadmin: fix root ca verification #792

Merged
merged 2 commits into from
Sep 22, 2016
Merged

Conversation

joshuarubin
Copy link
Contributor

nsqadmin needs to set the tlsCertPool with the root ca certificate as the RootCAs field of tls.Config and not ClientCAs since it is verifying the nsqd server and not validating incoming client connections itself.

Here is the documentation from the tls package:

// RootCAs defines the set of root certificate authorities
// that clients use when verifying server certificates.
// If RootCAs is nil, TLS uses the host's root CA set.
RootCAs *x509.CertPool

// ClientCAs defines the set of root certificate authorities
// that servers use if required to verify a client certificate
// by the policy in ClientAuth.
ClientCAs *x509.CertPool

@mreiferson mreiferson changed the title fix nsqadmin root ca verification nsqadmin: fix root ca verification Sep 9, 2016
@mreiferson
Copy link
Member

@joshuarubin thanks! I guess we're missing a test here, any interest in adding one?

@mreiferson mreiferson added the bug label Sep 9, 2016
@joshuarubin
Copy link
Contributor Author

test added

@mreiferson
Copy link
Member

It's (obviously) been broken for a long time, but after scanning the code I don't even think it's making https requests internally! 😭

@joshuarubin
Copy link
Contributor Author

I'm not sure what you are referring to, but the nsqd server has require-verify enabled so that connection, from nsqadmin, is certainly using tls

@joshuarubin
Copy link
Contributor Author

Anything I can do to help move this along?

@mreiferson
Copy link
Member

Ahh, I forgot that it "negotiates" HTTPS automatically.

LGTM

@mreiferson mreiferson merged commit 807b727 into nsqio:master Sep 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants