0

我正在尝试使用 Laravel Queue 发送排队通知,但是当我在测试站点中运行它时出现此错误。我正在使用 LetsEncrypt 为 https 生成的证书。

production.ERROR: cURL error 60: Peer's Certificate issuer is not recognized. (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) {"exception":"[object] (GuzzleHttp\\Exception\\RequestException(code: 0): cURL error 60: Peer's Certificate issuer is not recognized. (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) at /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:201)
[stacktrace]
#0 /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(155): GuzzleHttp\\Handler\\CurlFactory::createRejection(Object(GuzzleHttp\\Handler\\EasyHandle), Array)

我在错误链的下游也看到了这一点:

#23 /var/www/html/vendor/laravel/framework/src/Illuminate/Notifications/SendQueuedNotifications.php(74): Illuminate\\Notifications\\ChannelManager->sendNow(Object(App\\User), Object(App\\Notifications\\CustomMailNotification), Array)

知道我做错了什么或不正确。我在 DigitalOcean 上托管

4

1 回答 1

0

我的本地环境(Laravel 7 / Http Client)也有同样的问题:

解决方案是在“withOptions”方法中为 de GuzzleHttp 客户端添加选项以禁用验证

 $options = ['verify'=>false];

如果是本地环境,则带有条件的代码:

    public function authApi(){

        $options = [];

        if (App::environment('local')) {
            $options = ['verify'=>false];
        }
        return Http::withBasicAuth($this->client_key, $this->client_key_secret)->withOptions($options);

    }
于 2020-08-27T04:10:56.377 回答