【问题标题】:I can't hit google recapcha api to get response. Captcha is v-2我无法点击 google recaptcha api 来获得响应。验证码是 v-2
【发布时间】:2021-12-22 22:39:58
【问题描述】:
     use Illuminate\Support\Facades\Http; 

  
$response = Http::asForm()->post('https://www.google.com/recaptcha/api/siteverify', [
        'secret' => '6LftPCIdAAAAAPD5Md-fahgg3sj0SCUhV9qC5e9B',  
        'response' => request('Response')
    ])->json();
    return $response;

我得到的错误是:

GuzzleHttp\Exception\RequestException:cURL 错误 60:SSL 证书问题:无法在文件 D:\CODE\flowlence-api\vendor\guzzlehttp\guzzle\ 中获取 https://www.google.com/recaptcha/api/siteverify 的本地颁发者证书(请参阅 https://curl.haxx.se/libcurl/c/libcurl-errors.html) src\Handler\CurlFactory.php 在第 211 行

我尝试过这样做,但没有成功 cURL error 60: SSL certificate in Laravel 5.4

而且我没有 xampp 或 wamp。

谢谢。

【问题讨论】:

  • 响应是recaptcha创建的令牌

标签: google-api laravel-8 recaptcha


【解决方案1】:

我已经解决了。 因为我不使用 Xampp 或 Wamp,所以我去了 PHP\v7.4\extras\ssl 并在那里粘贴了 cacert.pem

在 php.ini 中,我发现 curl.cainfo = C:\Program Files (x86)\PHP\v7.4\extras\ssl\cacert.pem 并通过删除取消注释它;

重新启动本地主机,它可以工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-10-28
    • 1970-01-01
    • 1970-01-01
    • 2015-11-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-15
    相关资源
    最近更新 更多