summaryrefslogtreecommitdiffstats
path: root/lib/puppet/ssl
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-04-17 21:39:24 -0500
committerLuke Kanies <luke@madstop.com>2008-04-17 21:39:24 -0500
commit71db9b58349f75a54649d9b0d1fead8d01593f7a (patch)
tree4e17f61f1b53863477e6917818bb1893a55693b1 /lib/puppet/ssl
parente5c4687593766955de09e5613c892ce82a2a989d (diff)
downloadpuppet-71db9b58349f75a54649d9b0d1fead8d01593f7a.tar.gz
puppet-71db9b58349f75a54649d9b0d1fead8d01593f7a.tar.xz
puppet-71db9b58349f75a54649d9b0d1fead8d01593f7a.zip
Adding integration tests for a lot of the SSL code.
This flushed out some problems, and things mostly look good now, but I don't think we're quite there yet.
Diffstat (limited to 'lib/puppet/ssl')
-rw-r--r--lib/puppet/ssl/certificate_authority.rb3
-rw-r--r--lib/puppet/ssl/host.rb4
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/puppet/ssl/certificate_authority.rb b/lib/puppet/ssl/certificate_authority.rb
index 2ed45e08b..f9786fb1a 100644
--- a/lib/puppet/ssl/certificate_authority.rb
+++ b/lib/puppet/ssl/certificate_authority.rb
@@ -27,7 +27,7 @@ class Puppet::SSL::CertificateAuthority
request.generate(host.key)
# Create a self-signed certificate.
- @certificate = sign(name, :ca, request)
+ @certificate = sign(host.name, :ca, request)
end
def initialize
@@ -40,7 +40,6 @@ class Puppet::SSL::CertificateAuthority
# Sign a given certificate request.
def sign(hostname, cert_type = :server, self_signing_csr = nil)
-
# This is a self-signed certificate
if self_signing_csr
csr = self_signing_csr
diff --git a/lib/puppet/ssl/host.rb b/lib/puppet/ssl/host.rb
index 42f881568..9b0ba2c71 100644
--- a/lib/puppet/ssl/host.rb
+++ b/lib/puppet/ssl/host.rb
@@ -17,6 +17,8 @@ class Puppet::SSL::Host
attr_reader :name
attr_accessor :ca
+ attr_writer :key, :certificate, :certificate_request
+
CA_NAME = "ca"
# This is the constant that people will use to mark that a given host is
@@ -150,7 +152,7 @@ class Puppet::SSL::Host
def initialize(name)
@name = name
@key = @certificate = @certificate_request = nil
- @ca = false
+ @ca = (name == self.class.ca_name)
end
# Extract the public key from the private key.