如何在Guzzle v6中使用TLS1.2

时间:2018-04-06 12:48:13

标签: php guzzle guzzle6

到目前为止,我只是简单地创建了客户端:

$this->guzzle = new Client(['timeout' => 5, 'base_uri' => $uri]);

客户端与HTTPS端点通信。如何告诉Guzzle使用TLS1.2

1 个答案:

答案 0 :(得分:0)

那不是too hard

$this->guzzle = new Client(['timeout' => 5, 'base_uri' => $uri, 'curl' => [
    CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1_2
]]);