If you use Magento 2 and get an error like this:
Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:14095126:SSL routines:ssl3_read_n:unexpected eof while reading in ven dor/google/recaptcha/src/ReCap tcha/RequestMethod/Post.php on line 72
Trace:
<pre>#1 file_get_contents() called at [vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Post.ph p:72]
#2 ReCaptcha\RequestMethod\Post->submit() called at [vendor/google/recaptcha/src/R eCaptcha/ReCaptcha.php:156]
#3 ReCaptcha\ReCaptcha->verify() called at [app/code/MSP/ReCaptcha/Model/Validate.php:79]
#4 MSP\ReCaptcha\Model\Validate->validate() called at [app/code/MSP/ReCaptcha/Observ er/ReCaptchaObserver.php:93]
#5 MSP\ReCaptcha\Observer\ReCaptchaObserver->execute() called at [vendor/magento/framework/Even t/Invoker/InvokerDefault.php: 72]
#6 Magento\Framework\Event\Invoker\InvokerDefault->_callObserve rMethod() called at [vendor/magento/framework/Even t/Invoker/InvokerDefault.php: 60]
...
when trying to login to the admin panel, reset customer password, create a new customer account, etc., you can make a quick fix. To do this please follow the steps below:
1. Open and edit the file:
vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Post.php
2. Find & replace the line:
$response = file_get_contents($this->siteVerifyUrl, false, $context);
with
$response = @file_get_contents($this->siteVerifyUrl, false, $context);
Attention! This is just a temporary hardcode solution. As you know modifying of core files is restricted. That is why you need to create and apply a composer patch for this change. To learn about applying patches on Magento 2 please read Magento Documentation.
P.S.: don't forget to revert hardcode before applying the patch.