Unable to Connect to ssl
Asked Answered
O

4

7

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...

Ontiveros answered 13/1, 2012 at 5:24 Comment(3)
Error simply means that you can not connect to target host.Are you able to ping accounts.google.com at least? Are you able to connect to port 443 using opessl command is like "openssl s_client -connect accounts.google.com:443" ?You can try to increase timeout property valueMerman
Thanks for input ,But I am working in proxy server so I can't ping anything :( . For window I need to install openssl client. Please let me know may I do something else for workaround..Ontiveros
You answer to yourself.You are behind proxy.that the reason why you can not connect.Merman
R
13

Solution only for Windows users:

Check the SSL module is enabled in php.ini:

extension=php_openssl.dll
Ruberta answered 13/3, 2012 at 10:34 Comment(2)
That was my first step. By the way I resolved the issue. Thanks @RubertaOntiveros
@Ontiveros so what is the solution?Justin
Y
2

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:

// not working:
wget https://accounts.google.com:443
// working:
wget https://accounts.google.com:443 --no-check-certificate

or curl way:

// not working:
curl https://accounts.google.com:443
// working:
curl https://accounts.google.com:443 -k

To temporary solve it in my dev docker container, I have added use of curl adapter and no check for certificate to the code:

    $config = array(
        'adapter'     => 'Zend_Http_Client_Adapter_Curl',
        'curloptions' => [CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false]
    );
    $client = new Zend_Http_Client('https://example.com', $config);
Yama answered 20/12, 2017 at 9:41 Comment(2)
Fatal error: Call to undefined function url_combine()Ctenophore
@BotXtremSolutions yes, it is my internal function. Changed to some random.Yama
M
0

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

Merman answered 13/1, 2012 at 5:51 Comment(2)
Thank you for your help..Could u please help me where from I can change it. I'm newbie in Zend :(Ontiveros
I changed adapter in client.php Zend_Http_Client_Adapter_Proxy but it is also not working...Any helpOntiveros
B
0

If you on Ubuntu try add in your php.ini

openssl.capath=/etc/ssl/certs

For more info read this issue

Bobker answered 8/7, 2021 at 12:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.