Why I am getting “OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection” error on an API call with godaddy server?

自作多情 提交于 2019-12-24 09:09:43

问题


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);

来源:https://stackoverflow.com/questions/48559355/why-i-am-getting-openssl-ssl-connect-ssl-error-syscall-in-connection-error-on

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!