diff options
author | Luke Kanies <luke@madstop.com> | 2008-04-17 22:12:21 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-04-17 22:12:21 -0500 |
commit | fb56deae3488e5d97e10e38cba98393a5a8f8414 (patch) | |
tree | 9e6cff4304fdb8b972b2ff61a1b24e74552b3898 /lib/puppet/ssl/certificate_request.rb | |
parent | f7e0990fb436ce14e5f7ed295c004438d7735f95 (diff) | |
download | puppet-fb56deae3488e5d97e10e38cba98393a5a8f8414.tar.gz puppet-fb56deae3488e5d97e10e38cba98393a5a8f8414.tar.xz puppet-fb56deae3488e5d97e10e38cba98393a5a8f8414.zip |
Switching the SSL::Host class to return Puppet instances.
Previously, the class was returning OpenSSL instances
(e.g, OpenSSL::X509::Certificate) instead of Puppet instances
(e.g., Puppet::SSL::Certificate). This made some things
easier, but it made them asymmetric (e.g., you assigned the
key as a Puppet instance but got back an OpenSSL instance), and
it also reduced your flexibility and introspectiveness.
Diffstat (limited to 'lib/puppet/ssl/certificate_request.rb')
-rw-r--r-- | lib/puppet/ssl/certificate_request.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/puppet/ssl/certificate_request.rb b/lib/puppet/ssl/certificate_request.rb index 8ef0b800e..2c93a9c56 100644 --- a/lib/puppet/ssl/certificate_request.rb +++ b/lib/puppet/ssl/certificate_request.rb @@ -11,6 +11,9 @@ class Puppet::SSL::CertificateRequest < Puppet::SSL::Base def generate(key) Puppet.info "Creating a new SSL certificate request for %s" % name + # Support either an actual SSL key, or a Puppet key. + key = key.content if key.is_a?(Puppet::SSL::Key) + csr = OpenSSL::X509::Request.new csr.version = 0 csr.subject = OpenSSL::X509::Name.new([["CN", name]]) |