summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNimesh-Msys <nimesh.patni@msystechnologies.com>2019-02-27 15:43:50 +0530
committerTim Smith <tsmith@chef.io>2019-03-04 17:17:45 -0800
commitc50d0f2a4d766a5529b0ff1e9f9e5176c7f708b8 (patch)
tree33479f3da161c4085b031b8c9ab7197de21d7485
parent6e6b5ffbac4eb268a81b7535c1c26c54f9b3aeea (diff)
downloadchef-more_windows_cert_14.tar.gz
Adding support to import nested certificates through PFX certificatemore_windows_cert_14
- The following case was also identified in case of PFX certificate - Minor changes to allow import of ca_certs if they are present - Supporting changes have been sent in PR: https://github.com/chef/win32-certstore/pull/53 Signed-off-by: Nimesh-Msys <nimesh.patni@msystechnologies.com>
-rw-r--r--lib/chef/resource/windows_certificate.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/chef/resource/windows_certificate.rb b/lib/chef/resource/windows_certificate.rb
index 83294b7d3b..4607dabed6 100644
--- a/lib/chef/resource/windows_certificate.rb
+++ b/lib/chef/resource/windows_certificate.rb
@@ -282,7 +282,12 @@ class Chef
case ext
when ".pfx"
- OpenSSL::PKCS12.new(contents, new_resource.pfx_password).certificate
+ pfx = OpenSSL::PKCS12.new(contents, new_resource.pfx_password)
+ if pfx.ca_certs.nil?
+ pfx.certificate
+ else
+ [pfx.certificate] + pfx.ca_certs
+ end
when ".p7b"
OpenSSL::PKCS7.new(contents).certificates
else