Home >Backend Development >PHP Tutorial >How to Fix \'stream_socket_enable_crypto(): SSL operation failed with code 1\' Error in Laravel 4.2?
Fixing "stream_socket_enable_crypto(): SSL operation failed with code 1" Error
When attempting to send emails using Laravel 4.2 with SSL enabled, you may encounter the error:
"stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed"
This error indicates a failure in SSL verification. To resolve this issue, you can disable SSL verification by adding the following code to your /config/mail.php file:
<code class="php">'stream' => [ 'ssl' => [ 'allow_self_signed' => true, 'verify_peer' => false, 'verify_peer_name' => false, ], ],</code>
Note: Disabling SSL verification poses security risks, as it allows attackers to impersonate trusted endpoints and perform Man-in-the-Middle Attacks. Only use this solution if you fully understand the potential security implications.
After adding this code, your email sending should function correctly.
The above is the detailed content of How to Fix \'stream_socket_enable_crypto(): SSL operation failed with code 1\' Error in Laravel 4.2?. For more information, please follow other related articles on the PHP Chinese website!