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

Windows cert file paths being treated like inline certs #492

Closed
jsmartt opened this Issue Mar 29, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@jsmartt
Contributor

jsmartt commented Mar 29, 2017

I'm running v2.6.4 of the gem, and the code here determines if each cert is a path or inline certificate by checking if the string starts with a /. This is fine for Linux, but on my Windows box with Ruby 2.3.1 (provided in the Chef DK), that list of certs is:

[
  "C:/opscode/chefdk/embedded/ssl/certs/cacert.pem",
  "C:/opscode/chefdk/embedded/ssl/certs/ca-certificates.crt",
  "C:/opscode/chefdk/embedded/ssl/certs/ca-bundle.crt",
  "C:/opscode/chefdk/embedded/ssl/certs/ca-bundle.pem"
]

This causes these paths to be appended to the cert_inlines array, and eventually causes a OpenSSL::X509::CertificateError (not enough data) when it's added here.

I propose that the regex be updated from /^\// to /^([a-z]:?)?\//i to allow these Windows-style paths. I'd be glad to submit a PR to fix this, but wanted to run it by you guys first.
Thanks!

@jsmartt jsmartt referenced this issue Mar 29, 2017

Merged

Added SCMB module and CLI command #221

5 of 5 tasks complete
@michaelklishin

This comment has been minimized.

Show comment
Hide comment
@michaelklishin

michaelklishin Mar 29, 2017

Member

@jsmartt sounds reasonable. I'd introduce a class predicate method on Bunny::Transport and expose it for tests. Thank you!

Member

michaelklishin commented Mar 29, 2017

@jsmartt sounds reasonable. I'd introduce a class predicate method on Bunny::Transport and expose it for tests. Thank you!

@jsmartt

This comment has been minimized.

Show comment
Hide comment
@jsmartt

jsmartt Mar 29, 2017

Contributor

Great! Thanks @michaelklishin !

Contributor

jsmartt commented Mar 29, 2017

Great! Thanks @michaelklishin !

jsmartt added a commit to jsmartt/bunny that referenced this issue Apr 3, 2017

michaelklishin added a commit that referenced this issue Apr 3, 2017

@michaelklishin

This comment has been minimized.

Show comment
Hide comment
@michaelklishin

michaelklishin Apr 3, 2017

Member

@jsmartt do you need a preview release shortly or can you use the tip of 2.6.x-stable for some time?

Member

michaelklishin commented Apr 3, 2017

@jsmartt do you need a preview release shortly or can you use the tip of 2.6.x-stable for some time?

@jsmartt

This comment has been minimized.

Show comment
Hide comment
@jsmartt

jsmartt Apr 3, 2017

Contributor

Well this fixes an issue for a new feature, so that new feature will just be broken for Windows users until a new release is available on rubygems. So it's not urgent, but I'm not opposed to a release as soon as possible. 😉 I'm not pulling pre-releases though, so whenever you can get a 2.6.5 version out, I'll be able to use it.

Contributor

jsmartt commented Apr 3, 2017

Well this fixes an issue for a new feature, so that new feature will just be broken for Windows users until a new release is available on rubygems. So it's not urgent, but I'm not opposed to a release as soon as possible. 😉 I'm not pulling pre-releases though, so whenever you can get a 2.6.5 version out, I'll be able to use it.

@michaelklishin

This comment has been minimized.

Show comment
Hide comment
Member

michaelklishin commented Apr 15, 2017

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