Skip to content

Commit

Permalink
Make sure Curl uses TLS >= v1.2. Fixes #53.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Coates authored Aug 4, 2016
1 parent cb2d26a commit a3f0b24
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Message/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ public function getHttpMethod()

public function sendData($data)
{
// Stripe only accepts TLS >= v1.2, so make sure Curl is told
$config = $this->httpClient->getConfig();
$curlOptions = $config->get('curl.options');
$curlOptions[CURLOPT_SSLVERSION] = 6;
$config->set('curl.options', $curlOptions);
$this->httpClient->setConfig($config);

// don't throw exceptions for 4xx errors
$this->httpClient->getEventDispatcher()->addListener(
'request.error',
Expand Down

0 comments on commit a3f0b24

Please sign in to comment.