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

Windows cert file paths being treated like inline certs #492

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

Windows cert file paths being treated like inline certs #492

jsmartt opened this issue Mar 29, 2017 · 5 comments

Comments

@jsmartt
Copy link
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!

@michaelklishin
Copy link
Member

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

@jsmartt
Copy link
Contributor Author

jsmartt commented Mar 29, 2017

Great! Thanks @michaelklishin !

jsmartt added a commit to jsmartt/bunny that referenced this issue Apr 3, 2017
@michaelklishin
Copy link
Member

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

@jsmartt
Copy link
Contributor Author

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
Copy link
Member

@jsmartt 2.6.5 is out.

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

No branches or pull requests

2 participants