]> git.openstreetmap.org Git - chef.git/commitdiff
Use OS root certificiate bundle to avoid wordpress API via chef ruby
authorGrant Slater <github@firefishy.com>
Mon, 2 Dec 2024 21:16:35 +0000 (21:16 +0000)
committerGrant Slater <github@firefishy.com>
Mon, 2 Dec 2024 21:50:40 +0000 (21:50 +0000)
cookbooks/wordpress/libraries/wordpress.rb

index 92db4b19924c068079c5f7bc8b76a1e3428cf7bd..56df13936d08961dad1fef3b52c13df5901c7a0b 100644 (file)
@@ -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