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

Do not assume ca_key_path is a RSA key #40

Open
Lasering opened this issue Jun 26, 2018 · 0 comments
Open

Do not assume ca_key_path is a RSA key #40

Lasering opened this issue Jun 26, 2018 · 0 comments

Comments

@Lasering
Copy link

Cookbook Version

2.1.0

Scenario

Currently the cookbook assumes ca_key_path is a RSA key, which isn't always true.
https://github.com/zuazo/ssl_certificate-cookbook/blob/master/libraries/resource_ssl_certificate_generators.rb#L168

def generate_ca_from_content(cert_content, key_content)
  ca_cert = OpenSSL::X509::Certificate.new(cert_content)
  ca_key = OpenSSL::PKey::RSA.new(key_content, ca_key_passphrase)
  [ca_cert, ca_key]
end

This could be easily fixed with:

  ca_key = OpenSSL::PKey.read(key_content, ca_key_passphrase)

https://ruby.github.io/openssl/OpenSSL/PKey.html

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

No branches or pull requests

2 participants