狂饮无法绕过cURL错误35:SSL连接错误 [英] Guzzle unable to bypass cURL error 35: SSL connect error

查看:167
本文介绍了狂饮无法绕过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:

在Centos 6上更新cURL库

这篇关于狂饮无法绕过cURL错误35:SSL连接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆