jforrest / Chargify-PHP-Client

PHP client for Chargify
Please let me know if you have any questions.
MIT License
19 stars 16 forks source link

Send request problem after "January 2016, you must use TLS >= 1.2 in order to connect to the API." #18

Open akshoynavsoft opened 8 years ago

akshoynavsoft commented 8 years ago

When I send request via API from localhost then got the error " ChargifyConnectionException An error occurred while connecting to Chargify: SSL connect error (35) ". Same code was running fine before January 2016. Please help on it.

danielbangs commented 8 years ago

Managed to get it to work adding the following line in /lib/ChargifyConnector.php along with the other curl_setopt's:

curl_setopt($ch, CURLOPT_SSLVERSION, 6);

It relies on having a recent version of OpenSSL that supports TLSv1.2 (OpenSSL 1.0.1 or higher).