本地主机和"stream_socket_enable_crypto():SSL操作失败,代码为1". [英] localhost and "stream_socket_enable_crypto(): SSL operation failed with code 1"
问题描述
我正在使用gmail发送电子邮件,并且一切正常,但是突然它停止了工作.它向我展示了这一点
I was sending emails using gmail and everything was working perfectly, but suddendly it stoped working. And it shows me this
ErrorException in StreamBuffer.php line 94:
stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
in StreamBuffer.php line 94
at HandleExceptions->handleError('2', 'stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed', 'C:\xampp\htdocs\coparmex\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\StreamBuffer.php', '94', array())
at stream_socket_enable_crypto(resource, true, '9') in StreamBuffer.php line 94
at Swift_Transport_StreamBuffer->startTLS() in EsmtpTransport.php line 313
at Swift_Transport_EsmtpTransport->_doHeloCommand() in AbstractSmtpTransport.php line 118
at Swift_Transport_AbstractSmtpTransport->start() in Mailer.php line 79
at Swift_Mailer->send(object(Swift_Message), array()) in Mailer.php line 385
at Mailer->sendSwiftMessage(object(Swift_Message)) in Mailer.php line 171
这仅发生在我的本地主机中,在Web主机中工作正常.我不明白发生了什么事:c
And this only happends in my localhost, in the web host works fine. I don't understand what is going on :c
这些是我的gmail设置
These are my gmail settings
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=gmail
MAIL_PASSWORD=password
MAIL_ENCRYPTION=tls
推荐答案
您的SSL证书有误.您正在尝试使用没有适当证书的SSL连接(加密的安全连接).
That's an error with your SSL certificate. You're trying to use a SSL connection (encrypted, secure connection) without a proper certificate.
那是因为您要从本地主机连接,这是不安全的,并且被连接阻止.您可以通过将localhost连接更改为基于SSL的连接来避免这种情况.
That's because you're connecting from localhost, which isn't secure, and that is blocked by the connection. You could avoid that by changing your localhost connection to a SSL based one.
请参见此链接以获得更多详细信息.
See this link for more details.
这篇关于本地主机和"stream_socket_enable_crypto():SSL操作失败,代码为1".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!