Reputation: 309
I transfer my application from Laravel 4
to Laravel 5
, in sending email particularly in (reset Password).. I got this 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
but in laravel 4, it works.
Upvotes: 30
Views: 6546
Reputation: 329
That's an error with your SSL certificate. You are trying to use a SSL connection (encrypted, secure connection) without a proper certificate.
That's because you are connecting from localhost, which is not secure, and that is blocked by the connection. You could avoid that by changing your localhost connection to a SSL based one.
Also check and add below code in 'config/mail.php' this file.
'stream' => ['ssl'=>
['allow_self_signed'=>true, 'verify_peer'=>false, 'verify_peer_name'=>false]
],
Upvotes: 1
Reputation: 479
Add
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
));
before
mail->send()
and replace
require "mailer/class.phpmailer.php";
with
require "mailer/PHPMailerAutoload.php";
Upvotes: 1
Reputation: 17
Go to location \vendor\swiftmailer\lib\classes\Swift\Transport\StreamBuffer.php en la linea 259.Comment the following:
//$options = array();
and add. $options['ssl'] = array('verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true);
:D!
Upvotes: 1
Reputation: 19
you can use google app password ,for me it worked after changing the gmail password with app password you can do that by visiting my account>sign in>
Upvotes: 1
Reputation: 151
I faced similar problem so I set
MAIL_ENCRYPTION=
in .env file.
and it worked fine for me.
Upvotes: 4
Reputation: 21
If you are using basically Windows for development this is the common problem.
Changing your mail driver to "mail" from "smtp" will help.
Upvotes: 1
Reputation: 89
This error means that the SSL certificate verification is failing.
A quick fix would be to add to StreamBuffer.php these lines right after the condition:
if (!empty($this->_params['sourceIp']))
$options['ssl']['verify_peer'] = FALSE;
$options['ssl']['verify_peer_name'] = FALSE;
Upvotes: 1