Connecting with TLS1.2 using Zend_Http_Client in PHP

2017-12-21 18:39 (7 years ago) ytyng
$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.

Archive

2025
2024
2023
2022
2021
2020
2019
2018
2017
2016
2015
2014
2013
2012
2011