summaryrefslogtreecommitdiffstats
path: root/lib/puppet/ssl/certificate_request.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-03-11 19:27:32 -0500
committerLuke Kanies <luke@madstop.com>2008-04-15 21:34:04 -0500
commit0f46815b4e7b7970e9516166f47c0ec074bf0fa2 (patch)
treee1a237066f5216496cf9393f37d945985a99a7e2 /lib/puppet/ssl/certificate_request.rb
parent00e35bce4e8b7f4e0e4ee039a1d82ad9d08a6b96 (diff)
downloadpuppet-0f46815b4e7b7970e9516166f47c0ec074bf0fa2.tar.gz
puppet-0f46815b4e7b7970e9516166f47c0ec074bf0fa2.tar.xz
puppet-0f46815b4e7b7970e9516166f47c0ec074bf0fa2.zip
It looks like all of the new ssl classes for managing
keys, certificates, and requests now work, including talking to the certificate authority. Now we just need the authority itself, along with the necessary REST terminii.
Diffstat (limited to 'lib/puppet/ssl/certificate_request.rb')
-rw-r--r--lib/puppet/ssl/certificate_request.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/puppet/ssl/certificate_request.rb b/lib/puppet/ssl/certificate_request.rb
index fec9e1733..e8cbbbade 100644
--- a/lib/puppet/ssl/certificate_request.rb
+++ b/lib/puppet/ssl/certificate_request.rb
@@ -5,7 +5,7 @@ class Puppet::SSL::CertificateRequest < Puppet::SSL::Base
wraps OpenSSL::X509::Request
extend Puppet::Indirector
- indirects :certificate_request #, :terminus_class => :file
+ indirects :certificate_request, :extend => Puppet::SSL::IndirectionHooks
# How to create a certificate request with our system defaults.
def generate(key)
@@ -17,6 +17,8 @@ class Puppet::SSL::CertificateRequest < Puppet::SSL::Base
csr.public_key = key.public_key
csr.sign(key, OpenSSL::Digest::MD5.new)
+ raise Puppet::Error, "CSR sign verification failed; you need to clean the certificate request for %s on the server" % name unless csr.verify(key.public_key)
+
@content = csr
end
end