Your UX is waiting ...interact, engage, explore in Las Vegas at CloudWorld 2023

Learn more
What is this error ? and I want to connect API by https. — Cloud Customer Connect
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

What is this error ? and I want to connect API by https.

Received Response
48
Views
1
Comments
edited Jun 8, 2022 12:01PM in General Technical Discussions 1 comment

Content

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.

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!