stream_socket_enable_crypto(): SSL operation failed with code 1.
OpenSSL Error messages: error:14090086:SSL
routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Im using Laravel 4.2, PHP 5.6, Apache 2.4
I have GoDaddy SSL installed in Amazon ec2 Linux.
SSL working fine when i visit the site with https.
The error happened when I call my function :
<?php
public function sendEmail()
{
\Mail::send ( 'emails.code.code', $data, function ($sendemail) use($email) {
$sendemail->from ( 'info@me.com', 'Me Team' );
$sendemail->to ( $email, '' )->subject ( 'Activate your account' );
} );
}
?>
I read some articles about this, they said that there are things we should make some changes, they put that code but i don't know where to insert it.
Been reading this: https://www.mimar.rs/en/sysadmin/2015/php-5-6-x-ssltls-peer-certificates-and-hostnames-verified-by-default/
and this documentation of php http://php.net/manual/en/migration56.openssl.php which is hard to understand.
So my question is how to solve this problem?
Reading app/config/mailphp
Depending on your mail utilities installed on your machine, fill in the value of the driver key. I would do
I have also this error in laravel 4.2 I solved like this way. Find out
StreamBuffer.php
. For me I use xampp and my project name is itis_db for this my path is like this. So try to find according to your oneand find out this function inside StreamBuffer.php
and paste this two lines inside of this function
and reload your browser and try to run your project again. For me I put on like this:
Hope you will solve this problem.....
To resolve this problem you first need to check the SSL certificates of the host your are connecting to. For example using ssllabs or other ssl tools. In my case the intermediate certificate was wrong.
If the certificate is ok, make sure the openSSL on your server is up to date. Run
openssl -v
to check your version. Maybe your version is to old to work with the certificate.In very rare cases you might want to disable ssl security features like verify_peer, verify_peer_name or allow_self_signed. Please be very careful with this and never use this in production. This is only an option for temporary testing.
You should add below code in /config/mail.php ( tested and worked on laravel 5.1, 5.2, 5.4 )
in .env file
in config/mail.php
Try changing the
app/config/email.php
smtp
tomail