2017-02-22 17 views
3

私はかなり新しいですPHPさらにLaravelと私は次の奇妙な問題があります。「SSL証明書の問題:ローカル発行者証明書を取得できません」というエラーが表示される理由reCAPTCHAの検証中にエラーが発生しましたか?

私はこのようにGoogleのreCAPTCHAのフィールド、何かを含む登録フォームwitha開発しました:

<form method="post" action="/registration"> 

    ............................................................... 
    ............................................................... 
    ............................................................... 

    <div class="form-group"> 
     <label>Captcha</label> 
     <div class="input-group"> 
      {!! app('captcha')->display(); !!} 
     </div> 
    </div> 

    {{csrf_field()}} 

    <button type="submit" class="btn btn-default">Submit</button> 

</form> 

だから、この分野の靴古典的な「私はロボットではないよ」チェックボックスをオンにします。

このチェックボックスをオンにするだけであれば、/登録リソースを処理するコントローラにフォームが送信されても​​問題ありません。

これは、この要求をhande(関連する入力フォームバリ付き)制御方法であり、それは、フォーム入力の検証:とき、私の代わりに、いくつかの特定の画像を選択することを尋ねるポップアップが開かれている場合

public function store(Request $request) { 

    Log::info('store() START'); 

    $data = Input::all(); 

    Log::info('INSERTED DATA: '.implode("|", $data)); 

    $rules = array(
     'name' => 'required', 
     'surname' => 'required', 
     'login' => 'required', 
     'email' => 'required|email|confirmed', 
     //'email_confirmation' => 'required|email|confirmed', 
     'pass' => 'required|required', 
     //'passConfirm' => 'required', 
     'g-recaptcha-response' => 'required|captcha', 

    ); 

    $validator = Validator::make($data, $rules); 

    if ($validator->fails()){ 
     return Redirect::to('/registration')->withInput()->withErrors($validator); 
    } 
    else{ 
     // Do your stuff. 
    } 
} 

をこれは、以前のストア(リクエスト$リクエスト)コントローラメソッドに入る

RequestException in CurlFactory.php line 187: 
cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) 

in CurlFactory.php line 187 
at CurlFactory::createRejection(object(EasyHandle), array('errno' => 60, 'error' => 'SSL certificate problem: unable to get local issuer certificate', 'url' => 'https://www.google.com/recaptcha/api/siteverify', 'content_type' => null, 'http_code' => 0, 'header_size' => 0, 'request_size' => 0, 'filetime' => -1, 'ssl_verify_result' => 20, 'redirect_count' => 0, 'total_time' => 0.079000000000000001, 'namelookup_time' => 0.016, 'connect_time' => 0.032000000000000001, 'pretransfer_time' => 0, 'size_upload' => 0, 'size_download' => 0, 'speed_download' => 0, 'speed_upload' => 0, 'download_content_length' => -1, 'upload_content_length' => -1, 'starttransfer_time' => 0, 'redirect_time' => 0, 'redirect_url' => '', 'primary_ip' => '216.58.212.132', 'certinfo' => array(), 'primary_port' => 443, 'local_ip' => '168.202.22.52', 'local_port' => 50542)) in CurlFactory.php line 150 

:私は次のエラーメッセージを取得するフォームを送信します。私はこの問題は、この検証の設定に関連していることを考える:

'g-recaptcha-response' => 'required|captcha' 

私はそれがautomatially前のエラーメッセージにそれがあるべきこのIPをキャプチャをチェックするためにGoogleのサーバーに向けてコール(Infactは指定しないと思いますので、 Google関連:216.58.212.132)。

https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local-issuer-certificate

基本的にアパッチにsettedする必要がcacert.pemのファイルABOT speack:

だから、オンラインで検索、私はこの種のエラーに関連して、このようなものを見つけました。

それはこのようなものsasy:私はTHIファイル(https://curl.haxx.se/ca/cacert-2017-01-18.pemを)理解して持っているものから、そう

I had the exact same but on Windows & xampp. My solution was as simple as: Follow this link: http://curl.haxx.se/ca/cacert.pem Copy the entire page and save it in a: "cacert.pem"

Then in your php.ini file insert or edit the following line: curl.cainfo = "[pathtothisfile]\cacert.pem"

Problem solved

「のサーバーは、あなたが本当に正しいサイトであることを確認するために使用するCA証明書のバンドルですもう話している。

このファイルを私のApacheに設定していないという事実が、私の問題の原因になりますか?

私はそれを設定するために正確に何をしなければなりませんか?私は、このダウンロードしたファイルと何をするべきかについては考慮していません。自分で解決しよう

答えて

関連する問題