From 2fc706cf0215632d7eed93a16411c287dbc2cdd9 Mon Sep 17 00:00:00 2001 From: nmoein Date: Thu, 21 Apr 2016 07:51:43 -0700 Subject: [PATCH] Update ChargifyConnector.php Updated curl options to use TLS 1.2 for connection as per TLS Upgrade Notice of Chargify https://docs.chargify.com/tls-upgrade-notice --- lib/ChargifyConnector.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/ChargifyConnector.php b/lib/ChargifyConnector.php index 32f1314..d6e3c2c 100644 --- a/lib/ChargifyConnector.php +++ b/lib/ChargifyConnector.php @@ -48,10 +48,13 @@ private function sendRequest($uri, $format = 'XML', $method = 'GET', $data = '') $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://" . $this->active_domain . ".chargify.com" . $uri); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Don't verify Client SSL Certificate + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); // Don't verify Host SSl Certificate + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); // Don't follow redirection curl_setopt($ch, CURLOPT_MAXREDIRS, 1); + curl_setopt($ch, CURLOPT_FTP_SSL, CURLFTPSSL_ALL); // Force to ssl connection + curl_setopt($ch, CURLOPT_FTPSSLAUTH, CURLFTPAUTH_TLS); // Set to use TLS + curl_setopt($ch, CURLOPT_SSLVERSION, 6); // Set SSL protocol to TLSv1.2 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); if ($format == 'XML') { curl_setopt($ch, CURLOPT_HTTPHEADER, array( @@ -788,4 +791,4 @@ public function getTransactionsBySubscriptionID($subscription_id, $options = arr return $result; } } -?> \ No newline at end of file +?>