-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
use private key when creating x509 cert #170
Conversation
If there is a CAKey then use that, otherwise use a private key.
Sorry to get back to this so late. Why would you want to pass the key parameter when you are already passing the csr parameter? My understanding is that we have 2 cases here:
Am i wrong there? Do you see this differently? |
It's been some time since I worked on this at my job but I believe this code change was for the first use case you mentioned. Without the change, puppet happily attempt to create a certificate with OpenSSL but will error because no key was specified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase to resolve the merge conflict.
@@ -80,6 +80,8 @@ def create | |||
options << ['-CAcreateserial'] | |||
options << ['-CA', resource[:ca]] | |||
options << ['-CAkey', resource[:cakey]] | |||
else | |||
options << ['-key', resource[:private_key]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In 268ae1c the -signkey
option was added, which is an alias for -key
. So I think this is now redundant
ensure => $ensure, | ||
template => $_cnf, | ||
csr => $_csr, | ||
private_key => $_key, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't part of the current code. It happens to work now because private_key
defaults to the same value as $_key
defaults to. If a user passes in $key
it will fail, so this is still needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#186 only does this part. If that's merged, we can close this PR.
#186 was merged. |
Pull Request (PR) description
Fixes usage of
openssl::certificate::x509
where the private key was not passed into OpenSSL correctly. This could collide with L83 inlib/puppet/provider/x509_cert/openssl.rb
but I don't have time to test this use case.