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 vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Post.php on line 72

<pre>#1 file_get_contents() called at [vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Post.php:72]
#2 ReCaptcha\RequestMethod\Post->submit() called at [vendor/google/recaptcha/src/ReCaptcha/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/Observer/ReCaptchaObserver.php:93]
#5 MSP\ReCaptcha\Observer\ReCaptchaObserver->execute() called at [vendor/magento/framework/Event/Invoker/InvokerDefault.php:72]
#6 Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod() called at [vendor/magento/framework/Event/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:


2. Find & replace the line:

$response = file_get_contents($this->siteVerifyUrl, false, $context);


$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.