在Curl - 对等证书中获取错误无法使用已知CA证书进行身份验证 [英] Getting error in Curl - Peer certificate cannot be authenticated with known CA certificates
问题描述
在使用自签名证书进行ssl连接时,我收到以下错误。
对等证书不能使用已知的CA证书进行身份验证
I am getting the below error while making ssl connection with self signed certificate. "Peer certificate cannot be authenticated with known CA certificates"
它与CA签署的证书兼容。
我使用curl_easy_setopt()设置以下内容。
It is working fine with CA signed certificate. I am setting the below using curl_easy_setopt().
curl_easy_setopt(MyContext,CURLOPT_CAPATH,CA_CERTIFICATE_PATH)
curl_easy_setopt(MyContext,CURLOPT_SSL_VERIFYPEER,TRUE);
curl_easy_setopt(MyContext, CURLOPT_CAPATH, CA_CERTIFICATE_PATH) curl_easy_setopt(MyContext, CURLOPT_SSL_VERIFYPEER,TRUE);
卷曲版本
libcurl-7.19.7-26
The curl version
libcurl-7.19.7-26
Openssl版本0_9_8u。
Openssl version is 0_9_8u.
请让我知道如何解决这个问题。
Please let me know how to solve this issue.
推荐答案
p>为php关闭curl验证证书例如for curl_exec
for php switch off curl's verification of the certificate e.g. for curl_exec
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
http://php.net/manual/en/function.curl-setopt.php
这篇关于在Curl - 对等证书中获取错误无法使用已知CA证书进行身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!