Why I am getting “OpenSSL SSL_connect: SSL_ERROR_S

2019-08-12 22:40发布

I was trying to fetch details from a third party using API call.It is working fine with my localhost but when I uploaded it to live server, it is returning an error like this. Why it is happening?. I am using godaddy server,so do I need to change any configuration in its cpanel?. following is my call to api using curl

$ch = curl_init(); 
    curl_setopt($ch, CURLOPT_URL, "https://test.httpapi.com/api/domains/available.json?auth-userid=65464&api-key=key&domain-name=".$domain."&tlds=com" ); 

     curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      'Accept: application/json',
      'Content-Type: application/x-www-form-urlencoded;charset=UTF-8'
    ));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_SSLVERSION, 3);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_VERBOSE, true);

    $output = curl_exec($ch);
    $searchResult = curl_getinfo($ch);curl_close($ch);

0条回答
登录 后发表回答