我有一个问题。当您向 HTTPS 发送带有 CURL 库的 POST 请求时,收到错误:SSL 证书问题,请验证 CA 证书是否正常。详细信息:错误:14090086:SSL 例程:SSL3_GET_SERVER_CERTIFICATE:证书验证失败。使用当前证书。我尝试了来自http://www.startssl.com/certs/和 FROM http://curl.haxx.se/docs/caextract.html的各种证书 告诉我错误的原因可能是什么?这是 POST 请求的代码:
curl_setopt($process, CURLOPT_USERAGENT, $this->user_agent);
curl_setopt($process, CURLOPT_COOKIEFILE, $this->cookie_file);
curl_setopt($process, CURLOPT_COOKIEJAR, $this->cookie_file);
curl_setopt($process, CURLOPT_ENCODING , '');
curl_setopt($process, CURLOPT_CONNECTTIMEOUT, 120);
curl_setopt($process, CURLOPT_TIMEOUT, 120);
curl_setopt($process, CURLOPT_PROXY,$this->proxy);
curl_setopt($process, CURLOPT_POSTFIELDS, $data);
curl_setopt($process, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($process, CURLOPT_POST, 1);
curl_setopt($process,CURLOPT_VERBOSE,1);
if($ssl){
curl_setopt ($process, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt ($process, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($process ,CURLOPT_CAINFO, YiiBase::getPathOfAlias('webroot').'/files/GTECyberTrustGlobalRoot.crt');
}
curl_setopt ($process, CURLOPT_HTTPHEADER, array('Expect:'));
$return = curl_exec($process);
$this->error_code = curl_getinfo($process, CURLINFO_HTTP_CODE);