Failed to connect to ssl

I configured openssl using wamp (Apache server). But while I use gdata api, I get the 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 

Someone help me with this ...

+6
source share
3 answers

Verify that the SSL module is enabled in php.ini:

 extension=php_openssl.dll 
+13
source

You are behind a proxy server, so you cannot connect directly. Try using Zend / Http / Client / Adapter / Proxy.php instead of Zend \ Http \ Client \ Adapter \ Socket.php

0
source

The answer from Michael does not work for me, since I run it in Alpine Linux, and .dll is only a 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 a connection.

To verify that this is a problem, you can make a request:

wget path:

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

or curl:

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

To temporarily solve the problem in my dev docker container, I added the use of the curl adapter and did not check the certificate for code:

  $config = array( 'adapter' => 'Zend_Http_Client_Adapter_Curl', 'curloptions' => [CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false] ); $client = new Zend_Http_Client(url_combine([$this->_url, $call]), $config); 
0
source

Source: https://habr.com/ru/post/905885/


All Articles