Error: stream_socket_enable_crypto(): SSL operation failed with code 1. in laravel 5.2

♀尐吖头ヾ 提交于 2019-12-06 13:27:47

问题


Actually,I want to redirect my user to the email verification page after signup process and asking him/her to enter the verification code sent to his/her email. I will be glad if you tell me the process or recommend me any tutorial.

I have already made my working authentication system . I have searched a lot on internet but all i can find is the requirement of laravel auth which i am not using.

On signing up I am getting 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

If you need to see my code , just tell me. I'll post it.

UserController.php: http://laravel.io/bin/nQreq Routes.php:http://laravel.io/bin/JxjNB


回答1:


You should add below code in /config/mail.php ( worked on laravel 5.4 )

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

and .env mail setting will be something like

    MAIL_DRIVER=smtp
    MAIL_HOST=smtp.gmail.com
    MAIL_PORT=587
    MAIL_USERNAME=yourEmail
    MAIL_PASSWORD=youPassword
    MAIL_ENCRYPTION=tls


来源:https://stackoverflow.com/questions/38113860/error-stream-socket-enable-crypto-ssl-operation-failed-with-code-1-in-larav

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!