From c95347132f45f1f65d352cca6c6acb57764c22b4 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 2 May 2023 12:05:06 -0700 Subject: [chef-17] 19 of X - Refactoring the badssl.com code Signed-off-by: John --- .../end_to_end/recipes/_chef_client_trusted_certificate.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/_chef_client_trusted_certificate.rb b/kitchen-tests/cookbooks/end_to_end/recipes/_chef_client_trusted_certificate.rb index 28d6f4a882..223110565b 100644 --- a/kitchen-tests/cookbooks/end_to_end/recipes/_chef_client_trusted_certificate.rb +++ b/kitchen-tests/cookbooks/end_to_end/recipes/_chef_client_trusted_certificate.rb @@ -5,11 +5,15 @@ # First, grab it out = Mixlib::ShellOut.new( - %w{openssl s_client -showcerts -connect self-signed.badssl.com:443} + %w{openssl s_client -servername self-signed.badssl.com -showcerts -connect self-signed.badssl.com:443} ).run_command.stdout cert = Mixlib::ShellOut.new(%w{openssl x509}, input: out).run_command.stdout +puts "The cert object is of type : #{cert.class}" + +puts "Here is the cert : #{cert}" + # Second trust it chef_client_trusted_certificate "self-signed.badssl.com" do certificate cert @@ -18,4 +22,5 @@ end # see if we can fetch from our new trusted domain remote_file ::File.join(Chef::Config[:file_cache_path], "index.html") do source "https://self-signed.badssl.com/index.html" + mode 0640 end -- cgit v1.2.1