Curl error: SSL certificate problem: unable to get local issuer certificate

When I make a curl request I’m getting Curl error: SSL certificate problem: unable to get local issuer certificate

It’s been a while since I’ve had to deal with this in a dev environment. I know xampp takes care of it, and I remember having to do some weird configs with wamp.

Ideally I would like to not have to update my actual code to specify a cert directory or if I do, I’d love to be able to put it in my init file so it’s global. Essentially I’m packaging up my existing php application, so I’d rather not change that code if I don’t have to.

If someone could give me an idea of how to configure ExeOutput to deal with this, I’d be very much appreciative.

Did you include / compile the openssl extension into your software?

Been awhile since I have messed with exeout and curl, but if I recall, this may help:

$url = "https://example.com"; // Replace with the desired URL

$ch = curl_init(); // Initialize cURL session

// Set cURL options
curl_setopt($ch, CURLOPT_URL, $url); // Set the URL
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Return response as a string
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Disable SSL peer verification
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // Disable SSL host verification (not recommended)

// Execute the cURL request
$response = curl_exec($ch);

// Check for errors
if ($response === false) {
    echo "cURL Error: " . curl_error($ch);
} else {
    echo "Response: " . $response;
}

// Close the cURL session
curl_close($ch);
1 Like

We have a cURL topic in the documentation:
https://www.exeoutput.com/help/working-with-php/curl/#activate-curl-support-in-your-apps
Especially about SSL and HTTPS access:

Accessing secure websites with HTTPS

Without correct configuration, if you try to access an HTTPS (SSL or TLS-protected resource) in PHP using cURL, you are likely to fail.