summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlib/puppet/sslcertificates.rb4
-rw-r--r--lib/puppet/sslcertificates/ca.rb7
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/puppet/sslcertificates.rb b/lib/puppet/sslcertificates.rb
index a56e64add..a003c6551 100755
--- a/lib/puppet/sslcertificates.rb
+++ b/lib/puppet/sslcertificates.rb
@@ -124,7 +124,8 @@ module Puppet::SSLCertificates
end
def self.mkhash(dir, cert, certfile)
- hash = "%x" % cert.issuer.hash
+ # Make sure the hash is zero-padded to 8 chars
+ hash = "%08x" % cert.issuer.hash
hashpath = nil
10.times { |i|
path = File.join(dir, "%s.%s" % [hash, i])
@@ -149,6 +150,7 @@ module Puppet::SSLCertificates
break
}
+
return hashpath
end
require 'puppet/sslcertificates/certificate'
diff --git a/lib/puppet/sslcertificates/ca.rb b/lib/puppet/sslcertificates/ca.rb
index 04d950e21..aacf3352c 100644
--- a/lib/puppet/sslcertificates/ca.rb
+++ b/lib/puppet/sslcertificates/ca.rb
@@ -177,8 +177,13 @@ class Puppet::SSLCertificates::CA
# Create the root certificate.
def mkrootcert
+ # Make the root cert's name the FQDN of the host running the CA.
+ name = Facter["hostname"].value
+ if domain = Facter["domain"].value
+ name += "." + domain
+ end
cert = Certificate.new(
- :name => "CAcert",
+ :name => name,
:cert => @config[:cacert],
:encrypt => @config[:capass],
:key => @config[:cakey],