狂饮无法绕过cURL错误35:SSL连接错误
问题描述:
使用Guzzle 6,我尝试与使用自签名证书的Https端点进行通信。
Using Guzzle 6 I am attempting to communicate with an Https endpoint that uses a self-signed certificate.
我正在实例化Client类,如下所示:
I am instantiating my Client class as follows:
$authClient = new Client([
'base_uri' => config('app.auth_uri'),
'verify' => false
]);
并尝试请求:
$res = $this->authClient->request('POST', '/auth', [
'form_params' => [
'client_id' => 'XXXXXXXXXXXXXXX',
'username' => 'RSA',
'grant_type' => 'password'
]
]);
这是我得到的错误:
cURL error 35: SSL connect error (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
根据Guzzle文档,我应该做得足以绕过SSL错误。
According to the Guzzle docs I should have done enough to bypass the SSL error.
答
毕竟,事实证明我的cURL库不支持端点使用的TLS版本。这是我的Vagrant装箱的Centos 6.x服务器上的一个已知问题。
After all that, it turns out my cURL library didn't support the TLS version used by the endpoint. It's a known problem on Centos 6.x servers which my Vagrant box was.
我在本指南的帮助下更新了libcurl:
I updated my libcurl with the help of this guide: