Skip to content

Commit a3f0b24

Browse files
author
Andrew Coates
authored
Make sure Curl uses TLS >= v1.2. Fixes #53.
1 parent cb2d26a commit a3f0b24

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Message/AbstractRequest.php

+7
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,13 @@ public function getHttpMethod()
126126

127127
public function sendData($data)
128128
{
129+
// Stripe only accepts TLS >= v1.2, so make sure Curl is told
130+
$config = $this->httpClient->getConfig();
131+
$curlOptions = $config->get('curl.options');
132+
$curlOptions[CURLOPT_SSLVERSION] = 6;
133+
$config->set('curl.options', $curlOptions);
134+
$this->httpClient->setConfig($config);
135+
129136
// don't throw exceptions for 4xx errors
130137
$this->httpClient->getEventDispatcher()->addListener(
131138
'request.error',

0 commit comments

Comments
 (0)