Connecting with TLS1.2 using Zend_Http_Client in PHP

2017-12-21 09:39 (8 years ago)
Connecting with TLS1.2 using Zend_Http_Client in PHP
$client = new Zend_Http_Client($url);
$response = $client->request('GET');

I was doing it like this, but due to an issue with the OS, I couldn't connect using TLS 1.2.

It worked well when I switched to using the CURL adapter.

$config = array(
   'adapter'      => 'Zend_Http_Client_Adapter_Curl',
   'curloptions'  => array(CURLOPT_SSLVERSION => 6),
);
$client = new Zend_Http_Client($url, $config);

* CURLOPT_SSLVERSION => 6 stands for TLS1.2. If it's 5, it means 1.1.

https://www.howsmyssl.com/a/check

This site is very useful for checking encryption protocols.


Use of undefined constant CURL_SSLVERSION_TLSv1_2 · Issue #26 · wepay/PHP-SDK
https://github.com/wepay/PHP-SDK/issues/26

This page was very helpful.

Currently unrated
The author runs the application development company Cyberneura.
We look forward to discussing your development needs.

Categories

Archive