overtrue / easy-sms

📲 一款满足你的多种发送需求的短信发送轮子
MIT License
3.15k stars 547 forks source link

创蓝api curl error 60 #46

Closed znmin closed 7 years ago

znmin commented 7 years ago

运行页面报错 cURL error 60: SSL certificate problem: self signed certificate in certificate chain (seehttp://curl.haxx.se/libcurl/c/libcurl-errors.html)

controller 

$this->easySms->send('*****', [
                'content' => '您请求的验证码为: ' . $this->phoneCodeService->phoneCode($request->input('phone_number'))
            ]);
easy-sms.php

return [
    // HTTP 请求的超时时间(秒)
    'timeout' => 5.0,

    // 默认发送配置
    'default' => [
        // 网关调用策略,默认:顺序调用
        'strategy' => \Overtrue\EasySms\Strategies\OrderStrategy::class,

        // 默认可用的发送网关
        'gateways' => [
            'chuanglan'
        ],
    ],
    // 可用的网关配置
    'gateways' => [
        'errorlog' => [
            'file' => '/tmp/easy-sms.log',
        ],
        'chuanglan' => [
            'username'  => env('CHUANGLAN_USERNAME'),
            'password' => env('CHUANGLAN_PASSWORD'),
        ],
    ],
];
overtrue commented 7 years ago

证书问题自己解决

znmin commented 7 years ago

... 问题是创蓝api 不需要提供证书 啊. new GuzzleHttp\Client 的时候 需要设置 verify 为false,

overtrue commented 7 years ago

你环境的根证书问题, https 请求会验证根证书,关掉证书验证是不科学的玩法

znmin commented 7 years ago

行, 我再看看, 找找问题/..

znmin commented 7 years ago

..找到解决方案, http://guzzle-cn.readthedocs.io/zh_CN/latest/request-options.html#verify 感谢 提醒