Quantcast
Channel: Discussion Forum > Connect Data Services
Viewing all articles
Browse latest Browse all 2504

What is this error ? and I want to connect API by https. (1 Comment)

$
0
0

Topic by Haruki Maejima

Hi.  everyone,

I want to connect external API by cURL which I indicate as follows.

load_curl();
            $url = "https://<site>/api/rightnow";

               $curl = curl_init($url)
                    $options = array(                                           
                        CURLOPT_HTTPHEADER => array("Content-Type: application/json" ),        //HEADER
                        CURLOPT_POST => true,                                   //METHOD_POS
                        CURLOPT_RETURNTRANSFER => true,               
                        CURLOPT_CONNECTTIMEOUT_MS => 1000,                      
                        CURLOPT_POSTFIELDS => json_encode($post_args)           
                    );
                    curl_setopt_array($curl, $options)
                    $result = curl_exec($curl)

                    curl_close($curl);

But this error is happened.

error: 

SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate
verify failed
 

I know that I can avoid it by CURLOPT_SSL_VERIFYPEER => false and CURLOPT_SSL_VERIFYHOST => false.

However I don't want to set false .

I'd appreciate it if you would tell me any idea or the cause of error.

Best regards,


Viewing all articles
Browse latest Browse all 2504

Trending Articles