~bkerensa/ubuntu/raring/puppet/new-upstream-release

« back to all changes in this revision

Viewing changes to lib/puppet/sslcertificates/ca.rb

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2010-10-21 12:52:13 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: james.westby@ubuntu.com-20101021125213-x5pjaatmuv0i79jv
Tags: 2.6.3~rc1-0ubuntu1
* New upstream version
* debian/control:
  - move all puppet dependencies to puppet-common since all the code is
    actually located in puppet-common. 
  - move libaugeas from a recommend to a dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
 
148
148
  # Create the root certificate.
149
149
  def mkrootcert
150
 
    # Make the root cert's name the FQDN of the host running the CA.
151
 
    name = Facter["hostname"].value
 
150
    # Make the root cert's name "Puppet CA: " plus the FQDN of the host running the CA.
 
151
    name = "Puppet CA: #{Facter["hostname"].value}"
152
152
    if domain = Facter["domain"].value
153
153
      name += ".#{domain}"
154
154
    end
155
155
 
156
 
          cert = Certificate.new(
157
 
                
 
156
    cert = Certificate.new(
158
157
      :name => name,
159
158
      :cert => @config[:cacert],
160
159
      :encrypt => @config[:capass],
161
160
      :key => @config[:cakey],
162
161
      :selfsign => true,
163
162
      :ttl => ttl,
164
 
        
165
163
      :type => :ca
166
164
    )
167
165
 
241
239
      f << "%04X" % (serial + 1)
242
240
    }
243
241
 
244
 
 
245
 
          newcert = Puppet::SSLCertificates.mkcert(
246
 
                
 
242
    newcert = Puppet::SSLCertificates.mkcert(
247
243
      :type => :server,
248
244
      :name => csr.subject,
249
245
      :ttl => ttl,
250
246
      :issuer => @cert,
251
247
      :serial => serial,
252
 
        
253
248
      :publickey => csr.public_key
254
249
    )
255
250
 
256
 
 
257
251
    sign_with_key(newcert)
258
252
 
259
253
    self.storeclientcert(newcert)