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

Fix client verification and wording #77

Merged
merged 1 commit into from
Aug 22, 2014
Merged

Fix client verification and wording #77

merged 1 commit into from
Aug 22, 2014

Conversation

twmb
Copy link
Contributor

@twmb twmb commented Aug 21, 2014

Per 5429f88#commitcomment-7481700,
"When the tls.Config is used for a TLS client, it should be setting c.TlsConfig.RootCAs,
not .ClientCAs; otherwise there will be no possible roots to verify the server cert."

Because go-nsq is always used as a client, RootCAs needs to be set, not ClientCAs.

Lastly, the cert is public, not private, and the key is private, not public.

@@ -344,6 +344,7 @@ func (t *tlsConfig) Set(c *Config, option string, value interface{}) error {
return fmt.Errorf("ERROR: failed to append certificates from Certificate Authority file")
}
c.TlsConfig.ClientCAs = tlsCertPool
c.TlsConfig.RootCAs = tlsCertPool
Copy link
Member

Choose a reason for hiding this comment

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

it is always a client, regardless of being a Consumer or Producer, so I think we can just set RootCAs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point.

Per 5429f88#commitcomment-7481700,
"When the tls.Config is used for a TLS client, it should be setting c.TlsConfig.RootCAs,
not .ClientCAs; otherwise there will be no possible roots to verify the server cert."

Because go-nsq is always used as a client, RootCAs needs to be set, not ClientCAs.

Lastly, the cert is public, not private, and the key is private, not public.
@mreiferson
Copy link
Member

LGTM, thanks!

mreiferson added a commit that referenced this pull request Aug 22, 2014
Fix client verification and wording
@mreiferson mreiferson merged commit 066486d into nsqio:master Aug 22, 2014
@mreiferson mreiferson added the bug label Aug 22, 2014
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