0

Hi apologizes if this is answered, but i could not find it

I have setup a code to test on the openfigi, here is the sample

$data = array('idType' => 'ID_WERTPAPIER', 'idValue' => '851399', 'exchCode' => 'US');                                                                    
$data_string = json_encode($data);                                                                                   

$ch = curl_init('https://api.openfigi.com/v1/mapping');                                                                      

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                  
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json',                                                                                
                                            'Accept: application/json',
                                            'X-OPENFIGI-APIKEY: xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx'
                                            )  );                                                                                                                   


$result = curl_exec($ch);
echo $result; 

if (curl_errno($ch)) {
    print "Error: " . curl_error($ch);
} else {
    var_dump($result);
    curl_close($ch);
}

curl_close($ch);

but when i try to use it i get the error

Error: error setting certificate verify locations: CAfile: C:\xampp\apache\conf\extra\cacert.pem CApath: none

I have read all the info on the cacert.pm, downloaded it put it where suggested

added it to the php.ini file

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an absolute path.
curl.cainfo ="C:\xampp\apache\conf\extra\cacert.pem"

changed the backslashes to forward slashes

and yet no luck

would appreciate the help

thanks

LF00
  • 27,015
  • 29
  • 156
  • 295
user2115506
  • 23
  • 1
  • 6
  • Have you restarted/reloaded your webserver? – Federkun Dec 17 '16 at 13:32
  • Hithanks for the reply yes i did – user2115506 Dec 17 '16 at 13:35
  • 2
    Possible duplicate of [Laravel 5 Socialite - cURL error 77: error setting certificate verify locations](http://stackoverflow.com/questions/30240840/laravel-5-socialite-curl-error-77-error-setting-certificate-verify-locations) – Federkun Dec 17 '16 at 13:40
  • Hi i got something new now, 1st i just went to another stack page and re-downloaded the file, changed the path curl.cainfo="C:\xampp\php\ext\cacert.pem", please note did this path before, and then restart the xampp now i am getting "The request body is not an array.string(33) "The request body is not an array." Warning: curl_close(): 2 is not a valid cURL handle resource in C:\xampp\htdocs\ops-curl\curl-test.php on line 31" - so i am guessing the file file i download either got corrupted or it was an old file – user2115506 Dec 17 '16 at 14:02

0 Answers0