Reputation: 1234
Windows 10, Apache httpd 2.4, PHP 7.1.4, Laravel 5.5
Gmail's less secure is Allowed.
My .env file:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
[email protected]
MAIL_PASSWORD=password
MAIL_ENCRYPTION=ssl
Error Message:
Connection could not be established with host smtp.gmail.com
MAIL_PORT=587
MAIL_ENCRYPTION=tls
Error Message:
stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
How can I resolve the "certificate verify failed" error?
Upvotes: 3
Views: 3688
Reputation: 1234
If your operating system doesn't automatically manage your trusted certificate store:
Put the cacert.pem bundle somewhere you like; if you have self-signed certificates that need to be accepted, open the bundle in a text editor and add them to the end of the file.
Edit php.ini
to reference this file location:
curl.cainfo = D:/Servers/php/sslfiles/cacert.pem
openssl.cafile = D:/Servers/php/sslfiles/cacert.pem
Upvotes: 6
Reputation: 19
When you receive ssl certificate verification error, You can set these two variables in .env file:
MAIL_PORT=587
MAIL_ENCRYPTION=tcp
Upvotes: -1