summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-09-17 17:13:59 -0700
committerJames Turnbull <james@lovedthanlost.net>2009-11-20 07:24:51 +1100
commit28e1bc6e7b866727adfd16cba5418e08f1dd2fd8 (patch)
tree09d913f03257f4defbb873d189aa619df27c3455 /lib/puppet
parent2d4b795e81e4f7953210d51be56c77bed3b77609 (diff)
downloadpuppet-28e1bc6e7b866727adfd16cba5418e08f1dd2fd8.tar.gz
puppet-28e1bc6e7b866727adfd16cba5418e08f1dd2fd8.tar.xz
puppet-28e1bc6e7b866727adfd16cba5418e08f1dd2fd8.zip
Always using the CA_name constant instead of "ca"
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/network/http/webrick.rb2
-rw-r--r--lib/puppet/ssl.rb1
-rw-r--r--lib/puppet/ssl/certificate_authority.rb4
-rw-r--r--lib/puppet/ssl/host.rb6
4 files changed, 7 insertions, 6 deletions
diff --git a/lib/puppet/network/http/webrick.rb b/lib/puppet/network/http/webrick.rb
index bf4bf8859..e0fe8b621 100644
--- a/lib/puppet/network/http/webrick.rb
+++ b/lib/puppet/network/http/webrick.rb
@@ -104,7 +104,7 @@ class Puppet::Network::HTTP::WEBrick
results[:SSLStartImmediately] = true
results[:SSLEnable] = true
- unless Puppet::SSL::Certificate.find("ca")
+ unless Puppet::SSL::Certificate.find(Puppet::SSL::CA_NAME)
raise Puppet::Error, "Could not find CA certificate"
end
diff --git a/lib/puppet/ssl.rb b/lib/puppet/ssl.rb
index 1a3e8d13d..9cb67a66c 100644
--- a/lib/puppet/ssl.rb
+++ b/lib/puppet/ssl.rb
@@ -3,5 +3,6 @@ require 'puppet'
require 'openssl'
module Puppet::SSL # :nodoc:
+ CA_NAME = "ca"
require 'puppet/ssl/host'
end
diff --git a/lib/puppet/ssl/certificate_authority.rb b/lib/puppet/ssl/certificate_authority.rb
index 10d13c28e..8e4fd7a08 100644
--- a/lib/puppet/ssl/certificate_authority.rb
+++ b/lib/puppet/ssl/certificate_authority.rb
@@ -101,8 +101,8 @@ class Puppet::SSL::CertificateAuthority
# Retrieve (or create, if necessary) the certificate revocation list.
def crl
unless defined?(@crl)
- unless @crl = Puppet::SSL::CertificateRevocationList.find("ca")
- @crl = Puppet::SSL::CertificateRevocationList.new("ca")
+ unless @crl = Puppet::SSL::CertificateRevocationList.find(Puppet::SSL::CA_NAME)
+ @crl = Puppet::SSL::CertificateRevocationList.new(Puppet::SSL::CA_NAME)
@crl.generate(host.certificate.content, host.key.content)
@crl.save
end
diff --git a/lib/puppet/ssl/host.rb b/lib/puppet/ssl/host.rb
index 29b947eea..d7993e70e 100644
--- a/lib/puppet/ssl/host.rb
+++ b/lib/puppet/ssl/host.rb
@@ -10,6 +10,7 @@ require 'puppet/util/cacher'
class Puppet::SSL::Host
# Yay, ruby's strange constant lookups.
Key = Puppet::SSL::Key
+ CA_NAME = Puppet::SSL::CA_NAME
Certificate = Puppet::SSL::Certificate
CertificateRequest = Puppet::SSL::CertificateRequest
CertificateRevocationList = Puppet::SSL::CertificateRevocationList
@@ -30,7 +31,6 @@ class Puppet::SSL::Host
end
end
- CA_NAME = "ca"
# This is the constant that people will use to mark that a given host is
# a certificate authority.
def self.ca_name
@@ -171,7 +171,7 @@ class Puppet::SSL::Host
# get the CA cert first, since it's required for the normal cert
# to be of any use.
- return nil unless Certificate.find("ca") unless ca?
+ return nil unless Certificate.find(CA_NAME) unless ca?
return nil unless @certificate = Certificate.find(name)
unless certificate_matches_key?
@@ -224,7 +224,7 @@ class Puppet::SSL::Host
@ssl_store.add_file(Puppet[:localcacert])
# If there's a CRL, add it to our store.
- if crl = Puppet::SSL::CertificateRevocationList.find("ca")
+ if crl = Puppet::SSL::CertificateRevocationList.find(CA_NAME)
@ssl_store.flags = OpenSSL::X509::V_FLAG_CRL_CHECK_ALL|OpenSSL::X509::V_FLAG_CRL_CHECK
@ssl_store.add_crl(crl.content)
end