我有一个Vagrant盒子设置并运行。我正在尝试使用Guzzle连接到第三方服务的API。
根据我的理解,它有一些问题来验证证书或来自流浪者盒子的东西,这是一个虚拟机和API服务器。
非常感谢任何建议,谢谢。
这是我要回来的错误:
Fatal error: Uncaught exception 'Guzzle\Http\Exception\CurlException' with message '[curl] 77: error setting certificate verify locations:
CAfile: phar:///vagrant/web/vendor/guzzle.phar/src/Guzzle/Http/Resources/cacert.pem
CApath: /etc/ssl/certs
[url] https://www.domain.com/json/list?id=444&app_key=AAA [info] array (
'url' => 'https://www.domain.com/json/list?id=444&app_key=AAA',
'content_type' => NULL,
'http_code' => 0,
'header_size' => 0,
'request_size' => 0,
'filetime' => -1,
'ssl_verify_result' => 0,
'redirect_count' => 0,
'total_time' => 0.141022,
'namelookup_time' => 0.048923,
'connect_time' => 0.141025,
'pretransfer_time' => 0,
'size_upload' => 0,
'size_download' => 0,
'speed_download' => 0,
'speed_upload' => 0,
'download_content_length' => -1,
'upload_content_length' => -1,
'starttransfer_time' => 0,
'redirect_time' => 0,
'certinfo' =>
array (
),
'redirect_url' => '',
) [debug] in phar:///vagrant/web/vendor/guzzle.phar/src/Guzzle/Http/Curl/CurlMulti.php on line 555
答案 0 :(得分:2)
以前版本的Guzzle phar文件存在此问题。 PHP的curl绑定不支持从phar流包装器读取cacert文件:
CAfile:phar:///vagrant/web/vendor/guzzle.phar/src/Guzzle/Http/Resources/cacert.pem
如果你是从phar运行的话,我已经更新了phar的更高版本以在系统上使用cacert包。