cURL error 60: SSL certificate problem: self signed certificate when making call with Cron Job

Yes that’s because curl doesn’t inherit keychain/macOS trust settings. That’s a separate tool with its own thang going on. You can have it trust your custom cert, google it, might be a headache.

You can temporarily disable cert verification but no clue what the option is for wp_safe_remote_get().

For example in file_get_content() you can pass a $context which is essentially curl options, one of them being ‘verify_peer’ => false.

    $options = array(
        'ssl' => array(
        'verify_peer' => false
        )
    );
$myOwnShit = file_get_contents($url, '', stream_context_create($options));

I’m facing a similar issue where on the same OS version localwp fails to point at /etc/ssl/cert.pem so no https requests can be verified.

1 Like