Tuesday, April 12, 2022

[SOLVED] how to fix stream_socket_enable_crypto(): SSL operation failed with code 1

Issue

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 ( '[email protected]', '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?


Solution

Try changing the app/config/email.php

smtp to mail



Answered By - user4634724
Answer Checked By - David Marino (WPSolving Volunteer)