StreamBuffer.php 第 95 行中的 ErrorException:在 Laravel 5 中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29891202/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 11:26:58  来源:igfitidea点击:

ErrorException in StreamBuffer.php line 95: in laravel 5

phplaravellaravel-5

提问by jle2389

I transfer my application from Laravel 4to Laravel 5, in sending email particularly in (reset Password).. I got this error

我将我的应用程序从 转移Laravel 4Laravel 5,发送电子邮件,特别是在(重置密码)中。我收到了这个错误

stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL

Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

stream_socket_enable_crypto():SSL 操作失败,代码为 1。OpenSSL

错误消息:错误:14090086:SSL 例程:SSL3_GET_SERVER_CERTIFICATE:证书验证失败

but in laravel 4, it works.

但在 Laravel 4 中,它有效。

回答by Mohammad Mudassir

I faced similar problem so I set

我遇到了类似的问题,所以我设置

MAIL_ENCRYPTION=in .env file.

MAIL_ENCRYPTION=在 .env 文件中。

and it worked fine for me.

对我来说效果很好。

回答by YATIN SAGAR

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>

您可以使用谷歌应用密码,对我来说,它在使用应用密码更改 gmail 密码后起作用了,您可以通过访问我的帐户>登录>

回答by Matu95

Go to location \vendor\swiftmailer\lib\classes\Swift\Transport\StreamBuffer.php en la linea 259.Comment the following:

转到 location \vendor\swiftmailer\lib\classes\Swift\Transport\StreamBuffer.php en la linea 259.Comment 以下内容:

//$options = array();

//$options = array();

and add. $options['ssl'] = array('verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true);

并添加。$options['ssl'] = array('verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true);

:D!

:D!

回答by Vajiheh habibi

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";

回答by Kiran Kanzar

That's an error with your SSL certificate. You are trying to use a SSL connection (encrypted, secure connection) without a proper certificate.

这是您的 SSL 证书错误。您正在尝试使用没有正确证书的 SSL 连接(加密的安全连接)。

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.

那是因为您从 localhost 连接,这不安全,并且被连接阻止。您可以通过将本地主机连接更改为基于 SSL 的连接来避免这种情况。

Also check and add below code in 'config/mail.php' this file.

还要检查并在“config/mail.php”这个文件中添加以下代码。

'stream' => ['ssl'=> ['allow_self_signed'=>true, 'verify_peer'=>false, 'verify_peer_name'=>false] ],

'stream' => ['ssl'=> ['allow_self_signed'=>true, 'verify_peer'=>false, 'verify_peer_name'=>false] ],

回答by Raz Weizman

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:

此错误表示 SSL 证书验证失败。
一个快速的解决方法是在条件之后立即将这些行添加到 StreamBuffer.php:

if (!empty($this->_params['sourceIp']))

if (!empty($this->_params['sourceIp']))

$options['ssl']['verify_peer'] = FALSE;
$options['ssl']['verify_peer_name'] = FALSE;

回答by tusharvikky

If you are using basically Windows for development this is the common problem.

如果您基本上使用 Windows 进行开发,这是常见问题。

Changing your mail driver to "mail" from "smtp" will help.

将您的邮件驱动程序从“smtp”更改为“mail”会有所帮助。