Якщо ви використовуєте Magento 2 і отримуєте помилку типу

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

Trace:
<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]
...

під час спроби входу до панелі адміністратора, скидання пароля клієнта, створення нового облікового запису клієнта тощо, ви можете швидко виправити це. Щоб зробити це, виконайте наведені нижче дії:

1. Відкрийте та відредагуйте файл:

vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Post.php

2. Знайдіть та замініть рядок:

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

на

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

 

Увага!Це лише тимчасове жорстке кодове рішення. Як ви знаєте, зміна основних файлів обмежена. Саме тому вам потрібно створити та застосувати патч для цієї composer . Щоб дізнатися про застосування патчів у Magento 2, будь ласка, прочитайтеДокументація Magento.

P.S.: не забудьте скасувати жорсткий код перед застосуванням патча.