laravel 4 - how to fix stream_socket_enable_crypto(): SSL operation failed with code 1 -
stream_socket_enable_crypto(): ssl operation failed 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 visit site https.
the error happened when call 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 account' ); } ); } ?>
i read articles this, said there things should make changes, put code don't know 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 documentation of php http://php.net/manual/en/migration56.openssl.php hard understand.
so question how solve problem?
i have error in laravel 4.2 solved way. find out streambuffer.php
. me use xampp , project name itis_db path this. try find according one
c:\xampp\htdocs\itis_db\vendor\swiftmailer\swiftmailer\lib\classes\swift\transport\streambuffer.php
and find out function inside streambuffer.php
private function _establishsocketconnection()
and paste 2 lines inside of function
$options['ssl']['verify_peer'] = false; $options['ssl']['verify_peer_name'] = false;
and reload browser , try run project again. me put on this:
private function _establishsocketconnection() { $host = $this->_params['host']; if (!empty($this->_params['protocol'])) { $host = $this->_params['protocol'].'://'.$host; } $timeout = 15; if (!empty($this->_params['timeout'])) { $timeout = $this->_params['timeout']; } $options = array(); if (!empty($this->_params['sourceip'])) { $options['socket']['bindto'] = $this->_params['sourceip'].':0'; } $options['ssl']['verify_peer'] = false; $options['ssl']['verify_peer_name'] = false; $this->_stream = @stream_socket_client($host.':'.$this->_params['port'], $errno, $errstr, $timeout, stream_client_connect, stream_context_create($options)); if (false === $this->_stream) { throw new swift_transportexception( 'connection not established host '.$this->_params['host']. ' ['.$errstr.' #'.$errno.']' ); } if (!empty($this->_params['blocking'])) { stream_set_blocking($this->_stream, 1); } else { stream_set_blocking($this->_stream, 0); } stream_set_timeout($this->_stream, $timeout); $this->_in = &$this->_stream; $this->_out = &$this->_stream; }
hope solve problem.....
Comments
Post a Comment