我知道这里已经有类似的问题,但我认为我的问题不同了。我试图向一个propper SSL网站发出一个curl请求(它不是自签名的)。 我可以轻松设置选项,甚至可以将CA证书包导入到正确的位置。 我希望所有的好和好,但我仍然得到:
SSL certificate problem: unable to get local issuer certificate
我在这里和谷歌上环顾四周,似乎无法解决这个问题。 这是我的卷曲设置:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,2);
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_CERTINFO, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd()."/cookie_jar");
curl_setopt($ch, CURLOPT_HEADER, true);
$result = curl_exec($ch);
Edit2:这里是请求的详细输出:
* Adding handle: conn: 0x3472770
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x3472770) send_pipe: 1, recv_pipe: 0
* About to connect() to www.caixagest.pt port 443 (#0)
* Trying 195.234.134.196...
* Connected to www.caixagest.pt (195.234.134.196) port 443 (#0)
* error setting certificate verify locations:
CAfile: C:\Winginx\ssl\certs\ca-bundle-old.crt
CApath: none
* Closing connection 0
error setting certificate verify locations:
CAfile: C:\Winginx\ssl\certs\ca-bundle-old.crt
CApath: none
答案 0 :(得分:1)
如果没有URL,curl版本和编译选项以及CA捆绑包的内容,很难说,但最常见的情况是:
如果您有更多信息,可能会提供更详细的帮助。