From 5fbc96e38dd8dfcb3eb1ed0a5f4319ccaf244d6d Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Mon, 2 Dec 2024 21:16:35 +0000 Subject: [PATCH] Use OS root certificiate bundle to avoid wordpress API via chef ruby --- cookbooks/wordpress/libraries/wordpress.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cookbooks/wordpress/libraries/wordpress.rb b/cookbooks/wordpress/libraries/wordpress.rb index 92db4b199..56df13936 100644 --- a/cookbooks/wordpress/libraries/wordpress.rb +++ b/cookbooks/wordpress/libraries/wordpress.rb @@ -30,7 +30,9 @@ class Chef end def api_get(url) - @api_responses[url] ||= ::JSON.parse(::HTTPClient.new.get_content(url)) + http_client = ::HTTPClient.new + http_client.ssl_config.set_trust_ca("/etc/ssl/certs/ca-certificates.crt") + @api_responses[url] ||= ::JSON.parse(http_client.get_content(url)) end end end -- 2.39.5