Skip to content

Commit

Permalink
Ignore linter failures for CURL_SSLVERSION constants
Browse files Browse the repository at this point in the history
  • Loading branch information
kjc-stripe committed Jan 7, 2016
1 parent f3d8189 commit c1218c2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/HttpClient/CurlClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,18 @@ public function request($method, $absUrl, $headers, $params, $hasFile)
if (!Stripe::$verifySslCerts) {
$opts[CURLOPT_SSL_VERIFYPEER] = false;
}
// @codingStandardsIgnoreStart
// PSR2 requires all constants be upper case. Sadly, the CURL_SSLVERSION
// constants to not abide by those rules.
//
// Opt into TLS 1.x support on older versions of curl. This causes some
// curl versions, notably on RedHat, to upgrade the connection to TLS
// 1.2, from the default TLS 1.0.
if (!defined('CURL_SSLVERSION_TLSv1')) {
define('CURL_SSLVERSION_TLSv1', 1); // constant not defined in PHP < 5.5
}
$opts[CURLOPT_SSLVERSION] = CURL_SSLVERSION_TLSv1;
// @codingStandardsIgnoreEnd

curl_setopt_array($curl, $opts);
$rbody = curl_exec($curl);
Expand Down

0 comments on commit c1218c2

Please sign in to comment.