Showing with 8 additions and 1 deletion.
  1. +1 −0 lib/puppet/provider/java_ks/keytool.rb
  2. +7 −1 lib/puppet/type/java_ks.rb
1 change: 1 addition & 0 deletions lib/puppet/provider/java_ks/keytool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def to_pkcs12
'-inkey', @resource[:private_key],
'-name', @resource[:name]
]
cmd << [ '-certfile', @resource[:chain] ] if @resource[:chain]
tmpfile = Tempfile.new("#{@resource[:name]}.")
tmpfile.write(@resource[:password])
tmpfile.flush
Expand Down
8 changes: 7 additions & 1 deletion lib/puppet/type/java_ks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ def insync?(is)
accompanied by a signed certificate for the keytool provider.'
end

newparam(:chain) do
desc 'It has been found that some java applications do not properly send
intermediary certificate authorities, in this case you can bundle them
with the server certificate using this chain parameter.'
end

newparam(:password) do
desc 'The password used to protect the keystore. If private keys are
sebsequently also protected this password will be used to attempt
Expand All @@ -99,7 +105,7 @@ def insync?(is)
# Where we setup autorequires.
autorequire(:file) do
auto_requires = []
[:private_key, :certificate].each do |param|
[:private_key, :certificate, :chain].each do |param|
if @parameters.include?(param)
auto_requires << @parameters[param].value
end
Expand Down