SSL Connect Error in Curl and Php 5.3.3

本秂侑毒 提交于 2021-01-28 03:54:58

问题


My site worked perfectly since 3 years, with below code, now suddenly since 2 days it started giving below error :

SSL Connect error :- in Curl_error

Below is my code :

<?php
$this->ssl_cert = "path_to_my_cert.pem";
$session = curl_init($this->server_url);
curl_setopt($session, CURLOPT_HTTPHEADER, $this->request_header);
curl_setopt($session, CURLOPT_HEADER, true);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
curl_setopt($session, CURLOPT_TIMEOUT, 300);
curl_setopt ($session, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt ($session, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($session, CURLOPT_SSL_CIPHER_LIST, rsa_rc4_128_sha);
curl_setopt($session, CURLOPT_SSL_VERIFYPEER, TRUE);
curl_setopt($session, CURLOPT_CAINFO, $this->ssl_cert);
$response = curl_exec($session);

if (curl_errno($session)) {
    $curl_err = curl_error($session);
    return array("CURL_ERR", $curl_err);
} else {
    curl_close($session);
}
?>

I have 5 different api's working using the above same code and every thing worked perfectly since 3 years. Suddenly one of my api has started giving the error : SSL Connect error.

After few search on net, if found of few of the solutions and tried adding below code to but all in vein :

curl_setopt($session, CURLOPT_SSLVERSION, 3);

My PHP Version : 5.3.3 cURL Information : 7.9.17

来源:https://stackoverflow.com/questions/33317674/ssl-connect-error-in-curl-and-php-5-3-3

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