Guzzle unable to bypass cURL error 35: SSL connect error

和自甴很熟 提交于 2019-12-13 16:19:55

问题


Using Guzzle 6 I am attempting to communicate with an Https endpoint that uses a self-signed certificate.

I am instantiating my Client class as follows:

$authClient = new Client([
    'base_uri' => config('app.auth_uri'),
    'verify' => false
]);

And attempting a request:

$res = $this->authClient->request('POST', '/auth', [
        'form_params' => [
            'client_id' => 'XXXXXXXXXXXXXXX',
            'username' => 'RSA',
            'grant_type' => 'password'
        ]
    ]);

Here is the error I get:

cURL error 35: SSL connect error (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

According to the Guzzle docs I should have done enough to bypass the SSL error.


回答1:


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.

I updated my libcurl with the help of this guide:

Update cURL library on Centos 6



来源:https://stackoverflow.com/questions/37321794/guzzle-unable-to-bypass-curl-error-35-ssl-connect-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!