0

i'm having a problem using Seller Center SDK from this site:

https://github.com/rocket-internet-berlin/SellerCenterSDK-PHP

i did exactly like what he told. and when i came to the point to test it

php ./genericGetter.php

i got error saying:

curl error 60: ssl certificate problem: unable to get local issuer certificate

i tried to turn off my firewall and added cacert.pem from this site https://curl.haxx.se/ca/cacert.pem to my php.ini and still no luck. can someone provide a solution?

procatmer
  • 5,420
  • 3
  • 13
  • 20

3 Answers3

0

You can try add it to php.ini

curl.cainfo=c:\path\to\cacert.pem

And try set opt_option if still not work.

$options = array(
    CURLOPT_RETURNTRANSFER => true,     // return web page
    CURLOPT_HEADER         => false,    // don't return headers
    CURLOPT_FOLLOWLOCATION => true,     // follow redirects
    CURLOPT_ENCODING       => "",       // handle all encodings
    CURLOPT_USERAGENT      => "spider", // who am i
    CURLOPT_AUTOREFERER    => true,     // set referer on redirect
    CURLOPT_CONNECTTIMEOUT => 120,      // timeout on connect
    CURLOPT_TIMEOUT        => 120,      // timeout on response
    CURLOPT_MAXREDIRS      => 10,       // stop after 10 redirects
    CURLOPT_SSL_VERIFYPEER => false     // Disabled SSL Cert checks
);
curl_setopt_array( $ch, $options );
Quynh Nguyen
  • 2,959
  • 2
  • 13
  • 27
0

just figured it out.

inside vendor\guzzlehttp\guzzle\src\HandlerCurlFactory.php, on line 329; change;

$conf[CURLOPT_SSL_VERIFYPEER] = true;

to

$conf[CURLOPT_SSL_VERIFYPEER] = false;

so far, i don't know the side effect that might happens. but, it does work fine now.

hopefully this is useful for those who wants to work with Seller Center SDK.

procatmer
  • 5,420
  • 3
  • 13
  • 20
0

If you can trust the source that you are consuming the resources from then arguably I would say that you can deactivate that option temporally as you already did but I would recommend you to check the root of the issue for a long-term solution.

It seems that the issue is with curl not having a valid certificate:

  • Check if your server has the latest cacert.pem file which you can download from https://curl.haxx.se/docs/caextract.html and add to the server certs directory.
  • if the server uses a certificate signed by a CA represented in cacert then it might be expired, or the name might not match the domain name your SDK is using.

If you still not having a solution then check the link below to see if one of the options provided can give you a solution: curl: (60) SSL certificate : unable to get local issuer certificate