diff options
| author | Luke Kanies <luke@madstop.com> | 2008-03-19 23:46:43 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-04-15 21:34:06 -0500 |
| commit | b9d647974915da05af8036933e71bc1e6dc00374 (patch) | |
| tree | 61f4968c292a364978f8681bfccbd1730e6ab8cd /lib/puppet/ssl/certificate_factory.rb | |
| parent | 1efed0304ebdc13a55eb2d865cdc4965c5253d3a (diff) | |
| download | puppet-b9d647974915da05af8036933e71bc1e6dc00374.tar.gz puppet-b9d647974915da05af8036933e71bc1e6dc00374.tar.xz puppet-b9d647974915da05af8036933e71bc1e6dc00374.zip | |
We have a basically functional CA -- it can sign
requests and return certificates. There's still plenty
more work to do, but I'm probably not much more than a
day away from redoing puppetca to use this code.
Diffstat (limited to 'lib/puppet/ssl/certificate_factory.rb')
| -rw-r--r-- | lib/puppet/ssl/certificate_factory.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/puppet/ssl/certificate_factory.rb b/lib/puppet/ssl/certificate_factory.rb index 47b9f74d7..4b1669804 100644 --- a/lib/puppet/ssl/certificate_factory.rb +++ b/lib/puppet/ssl/certificate_factory.rb @@ -58,9 +58,11 @@ class Puppet::SSL::CertificateFactory method = "add_#{@cert_type.to_s}_extensions" - raise ArgumentError, "%s is an invalid certificate type" % @cert_type unless respond_to?(method) - - send(method) + begin + send(method) + rescue NoMethodError + raise ArgumentError, "%s is an invalid certificate type" % @cert_type + end @extensions << @ef.create_extension("nsComment", "Puppet Ruby/OpenSSL Generated Certificate") @extensions << @ef.create_extension("basicConstraints", @basic_constraint, true) @@ -72,7 +74,7 @@ class Puppet::SSL::CertificateFactory @cert.extensions = @extensions # for some reason this _must_ be the last extension added - @extensions << ef.create_extension("authorityKeyIdentifier", "keyid:always,issuer:always") if @cert_type == :ca + @extensions << @ef.create_extension("authorityKeyIdentifier", "keyid:always,issuer:always") if @cert_type == :ca end # TTL for new certificates in seconds. If config param :ca_ttl is set, |
