From 02feea25f48446f6324cc13dc07de35de5670d54 Mon Sep 17 00:00:00 2001 From: Nimesh-Msys Date: Wed, 27 Feb 2019 15:43:50 +0530 Subject: Adding support to import nested certificates through PFX certificate - 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 --- lib/chef/resource/windows_certificate.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/chef/resource') diff --git a/lib/chef/resource/windows_certificate.rb b/lib/chef/resource/windows_certificate.rb index d4ac9a29d6..e7261adfba 100644 --- a/lib/chef/resource/windows_certificate.rb +++ b/lib/chef/resource/windows_certificate.rb @@ -281,7 +281,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 -- cgit v1.2.1