anhskohbo / no-captcha

No CAPTCHA reCAPTCHA For Laravel.
https://packagist.org/packages/anhskohbo/no-captcha
MIT License
1.78k stars 234 forks source link

Timeout #53

Closed dann95 closed 7 years ago

dann95 commented 7 years ago

Hi there, since yesterday it stoped working making the following error:

file_get_contents(https://www.google.com/recaptcha/api/siteverify): failed to open stream: Connection timed out

running on terminal the following commands i have the results:

php -r "echo file_get_contents('https://www.google.com/recaptcha/api/siteverify');"

Results on:

PHP Warning:  file_get_contents(https://www.google.com/recaptcha/api/siteverify): failed to open stream: Connection timed out in Command line code on line 1

while, running:

curl https://www.google.com/recaptcha/api/siteverify
{
  "success": false,
  "error-codes": [
    "missing-input-response",
    "missing-input-secret"
  ]
}

is it exclusive issue for me that file_get_contents is not working anymore?

if you want guys i can make a PR using Guzzle, or curl..

dann95 commented 7 years ago

ping @anhskohbo

jehadja commented 7 years ago

hello, since tow days i have this issue too ErrorException in NoCaptcha.php line 125: file_get_contents(): SSL: Connection reset by peer thanks

anhskohbo commented 7 years ago

@dann95 Seem that trouble is by openssl (php.ini) in your machine or related with IPv6 issues. See: https://getcomposer.org/doc/articles/troubleshooting.md#operation-timed-out-ipv6-issues-

dann95 commented 7 years ago

@anhskohbo mine was not related to SSL , see error it says timed out, and as i show using curl it grabbed correctly. its weird, it backed work but get off that time.

dann95 commented 7 years ago

@anhskohbo dont u thinik better upgrade it to a curl, or curl wrapper like https://github.com/guzzle/guzzle

anhskohbo commented 7 years ago

Yes, I have plan to use Guzzle. BTW a pull request is welcome :)

eggnaube commented 7 years ago

@jehadja do you have any solution for that? I have this problem too.

jehadja commented 7 years ago

I am sorry I still have same problem I tried to composering update and it gives me error wich belong to ip6 as they told in recent comments so I understood that my problem on opeating system not in code I tried disable ip6 doesn't help so I am waiting to upload my code to another operating system to decide what I shall do .

chrishessler commented 7 years ago

I've had the same error. Maybe my solution will help:

The problem was the production server, which does NOT allow connections to external sources.

My solution was to add a 'proxy' => 'value' entry in the $context['http'] in sendRequestVerify() function.

Kind regards

dann95 commented 7 years ago

it still there =/ https://github.com/anhskohbo/no-captcha/pull/55

anhskohbo commented 7 years ago

Seem fixed https://github.com/anhskohbo/no-captcha/pull/55 Thanks @dann95