I have a site running locally on MAMP Pro (macos) and keep getting cURL errors when I use wp_remote_get()
I've searched and tried multiple solutions, but nothing seems to work.
My code:
$url = site_url() . '/wp-json/wp/v2/my-cpt'; // This works just fine and shows up in the browser correctly
$response = wp_remote_get( $url ); // this outputs the cURL error: "cURL error 60: SSL certificate problem: unable to get local issuer certificate"
I have:
This is more of a local work around. You can disable SSL verification within your local site. This can be accomplished by adding this line into the file wp-includes/functions.php or
/wp-content/themes/YOUR_THEME/functions.php
add_filter('https_ssl_verify', '__return_false');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With