jlevers / selling-partner-api

A PHP client library for Amazon's Selling Partner API
BSD 3-Clause "New" or "Revised" License
398 stars 185 forks source link

CURL error when calling aPlusContentV20201101->SearchContentDocuments #775

Closed TonyMarston closed 4 weeks ago

TonyMarston commented 1 month ago

Problem description:

I am getting an error when calling when calling aPlusContentV20201101->SearchContentDocuments

Error:

cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.amazon.com/auth/o2/token

Code


$connector = new SellingPartnerApi(
    clientId: '<LWA client ID>',
    clientSecret: '<LWA client secret>',
    refreshToken: '<LWA refresh token>',
    endpoint: Endpoint::{$endpoint}
);
$connector = $connector->seller();

$api = $connector->aPlusContentV20201101();
try {
    $result = $api->SearchContentDocuments($marketplace_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling aPlusContentV20201101->SearchContentDocuments: ',
        $e->getMessage(),
        PHP_EOL;
}
jlevers commented 4 weeks ago

This is some sort of network issue, and is unrelated to this library. I've seen quite a few people run into this issue, and typically there's some sort of missing CA certificate.

Edit: I should also mention that this is sometimes an issue on Amazon's end that just resolves itself after a while.

TonyMarston commented 3 weeks ago

I have solved this problem by following https://stackoverflow.com/questions/29822686/curl-error-60-ssl-certificate-unable-to-get-local-issuer-certificate