Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to Connect to ssl

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

like image 764
Neelesh Avatar asked Jan 13 '12 05:01

Neelesh


People also ask

Can not connect with SSL?

If you have installed an antivirus or security application on your Android phone, try temporarily disabling it and then start browsing again. Sometimes these apps can interfere with your browser in a way that causes the SSL connection to fail.


Video Answer


2 Answers

Solution only for Windows users:

Check the SSL module is enabled in php.ini:

extension=php_openssl.dll
like image 178
Mikhail Avatar answered Oct 08 '22 00:10

Mikhail


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);
like image 45
Andrey L. Avatar answered Oct 08 '22 01:10

Andrey L.