From a3f0b24721c0a9e024f109bad808b0c4bfc192eb Mon Sep 17 00:00:00 2001 From: Andrew Coates Date: Thu, 4 Aug 2016 16:32:48 +0100 Subject: [PATCH] Make sure Curl uses TLS >= v1.2. Fixes #53. --- src/Message/AbstractRequest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Message/AbstractRequest.php b/src/Message/AbstractRequest.php index d70d6cee..3b6c00be 100644 --- a/src/Message/AbstractRequest.php +++ b/src/Message/AbstractRequest.php @@ -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',