无法连接到 ssl
我已经使用 wamp (Apache 服务器)配置了 openssl。但是当我使用 gdata api 时,我收到以下错误。
( ! ) Fatal error: Uncaught exception 'Zend_Http_Client_Adapter_Exception' with message ' in C:\Zend_1_11_11\library\Zend\Http\Client\Adapter\Socket.php on line 234
( ! ) Zend_Http_Client_Adapter_Exception: Unable to Connect to ssl://accounts.google.com:443. Error #10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\Zend_1_11_11\library\Zend\Http\Client\Adapter\Socket.php on line 234
有人帮我解决这个问题...
I have configured the openssl with wamp (Apache server). But while I using gdata api I'm getting following error.
( ! ) Fatal error: Uncaught exception 'Zend_Http_Client_Adapter_Exception' with message ' in C:\Zend_1_11_11\library\Zend\Http\Client\Adapter\Socket.php on line 234
( ! ) Zend_Http_Client_Adapter_Exception: Unable to Connect to ssl://accounts.google.com:443. Error #10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\Zend_1_11_11\library\Zend\Http\Client\Adapter\Socket.php on line 234
Somebody help me on this...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
仅适用于 Windows 用户的解决方案:
检查 php.ini 中是否启用了 SSL 模块:
Solution only for Windows users:
Check the SSL module is enabled in php.ini:
Mikhail 的回答对我不起作用,因为我在 Alpine Linux 中运行它,而 .dll 只是 Windows 扩展名。不要在 Windows 之外使用它,它只会添加警告。
解决了我的问题:
我有一个无法建立连接的自签名证书。
要检查这是否是问题,您可以发出请求:
wget way:
或curl way:
为了在我的开发docker容器中临时解决它,我在代码中添加了curl适配器的使用,并且不检查证书:
Answer from Mikhail does not work for me as I run it in Alpine Linux and .dll is only windows extension. Do not use it outside of Windows, it only adds warnings.
Solved my problem:
I had a self-signed certificate that was unable to establish connection.
To check that it is problem you can make a request:
wget way:
or curl way:
To temporary solve it in my dev docker container, I have added use of curl adapter and no check for certificate to the code:
您位于代理后面,因此无法直接连接。尝试使用 Zend/Http/Client/Adapter/Proxy.php 而不是 Zend\Http\Client\Adapter\Socket.php
You are behind proxy, so you can not connect directly.Try to use Zend/Http/Client/Adapter/Proxy.php instead of Zend\Http\Client\Adapter\Socket.php
如果您使用 Ubuntu,请尝试添加
php.ini
有关更多信息,请阅读这个问题
If you on Ubuntu try add in your
php.ini
For more info read this issue