Symfony HWIOAuthBundle,如何配置cURL? [英] Symfony HWIOAuthBundle, how to configure cURL?
问题描述
在开发机器上,我们有apache附带的默认证书,当我们尝试使用Facebook进行身份验证时, HWIOAuthBundle 触发异常:
On the development machine we have the default certificates that comes with apache, when we trying to authenticate with facebook, HWIOAuthBundle fires an exception:
SSL证书问题:无法获取本地颁发者证书
SSL certificate problem: unable to get local issuer certificate
很明显,在纯PHP中,我们需要设置一个选项 CURLOPT_SSL_VERIFYPEER = false
,并传递给 curl_setopt_array(...)
。
It's clear that in plain PHP we need to set an option CURLOPT_SSL_VERIFYPEER = false
, and pass to curl_setopt_array(...)
.
如何为Symfony或 HWIOAuthBundle ?
How can we define these options for Symfony or for HWIOAuthBundle?
推荐答案
在hwi_oauth下添加以下选项,您应该就可以了。
Add following options under "hwi_oauth" and you should be fine.
hwi_oauth:
http_client:
verify_peer: false
这篇关于Symfony HWIOAuthBundle,如何配置cURL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!