Ticket #896: sslcertificates.patch
| File sslcertificates.patch, 1.4 kB (added by whaymand_home, 1 year ago) |
|---|
-
sslcertificates.rb
old new 9 9 end 10 10 11 11 module Puppet::SSLCertificates 12 #def self.mkcert(type, name, ttl, issuercert, issuername, serial, publickey)12 #def self.mkcert(type, name, dnsnames, ttl, issuercert, issuername, serial, publickey) 13 13 def self.mkcert(hash) 14 14 [:type, :name, :ttl, :issuer, :serial, :publickey].each { |param| 15 15 unless hash.include?(param) … … 39 39 basic_constraint = nil 40 40 key_usage = nil 41 41 ext_key_usage = nil 42 subject_alt_name = [] 42 43 43 44 ef = OpenSSL::X509::ExtensionFactory.new 44 45 … … 60 61 key_usage = %w{cRLSign keyCertSign} 61 62 when :server: 62 63 basic_constraint = "CA:FALSE" 64 hash[:dnsnames].each(':') { |d| 65 subject_alt_name << 'DNS:' + d 66 } if hash[:dnsnames] 63 67 key_usage = %w{digitalSignature keyEncipherment} 64 68 ext_key_usage = %w{serverAuth clientAuth} 65 69 when :ocsp: … … 86 90 if ext_key_usage 87 91 ex << ef.create_extension("extendedKeyUsage", ext_key_usage.join(",")) 88 92 end 93 if ! subject_alt_name.empty? 94 ex << ef.create_extension("subjectAltName", subject_alt_name.join(",")) 95 end 89 96 90 97 #if @ca_config[:cdp_location] then 91 98 # ex << ef.create_extension("crlDistributionPoints",