?
avatar fhariano
fhariano
29 May 2017

Steps to reproduce the issue

Set global configuration as USE SMTP, and use a GMAIL ACCOUNT.

Expected result

E-mail sent with success!

Actual result

PHP Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed

System information (as much as possible)

Additional comments

SOLUTIONS:
Editing file: libraries\joomla\mail\mail.php
Function: useSmtp
Line number approx.: #630
Change the lines:
if ($secure == 'ssl' || $secure == 'tls')
{
$this->SMTPSecure = $secure;
}

To:
if ($secure == 'ssl' || $secure == 'tls')
{
$this->SMTPSecure = $secure;
$this->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
}

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
1.00

avatar fhariano fhariano - open - 29 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 29 May 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 29 May 2017
avatar fhariano fhariano - edited - 29 May 2017
avatar brianteeman
brianteeman - comment - 29 May 2017

Did you tell google to use less secure apps
https://support.google.com/accounts/answer/6010255

avatar fhariano
fhariano - comment - 29 May 2017

Google say:
"We don't recommend this option because it might make it easier for someone to break into your account."

avatar brianteeman
brianteeman - comment - 29 May 2017

They also say
in order for Google to authorize a third party server to access your account via SMTP now, you have to enable “Less Secure Apps” on your gmail account.

avatar brianteeman
brianteeman - comment - 29 May 2017

personally I would always use the smtp server for my domain and not any 3rd party one

avatar fhariano
fhariano - comment - 29 May 2017

I know, but I'm in test phase.
I changed to disable “Less Secure Apps” the error continues.

Now I tested with an ACCOUNT OFFICE 365, and I get same error.

Just works with the options:

$this->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);

avatar Quy
Quy - comment - 29 May 2017

Was this working in v3.6.5 and now it is in issue in v3.7.2? I have SSL SMTP working with SMTP2GO but I am still on v3.6.5 waiting to upgrade to v3.7.3.

avatar mbabker
mbabker - comment - 29 May 2017

Turning off peer verification isn't a good idea. It partially defeats the
point of using a secure connection as you wouldn't verify the remote
connection is going where you intend.

On Mon, May 29, 2017 at 11:14 PM Flavio Henrique Ferreira Ariano <
notifications@github.com> wrote:

Steps to reproduce the issue

Set global configuration as USE SMTP, and use a GMAIL ACCOUNT.
Expected result

E-mail sent with success!
Actual result

PHP Warning: stream_socket_enable_crypto(): SSL operation failed with code

  1. OpenSSL Error messages:
    error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify
    failed
    System information (as much as possible) Additional comments

SOLUTIONS:
Editing file: libraries\joomla\mail\mail.php
Function: useSmtp
Line number approx.: #630
#630
Change the lines:
if ($secure == 'ssl' || $secure == 'tls')
{
$this->SMTPSecure = $secure;
}

To:
if ($secure == 'ssl' || $secure == 'tls')
{
$this->SMTPSecure = $secure;
$this->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
}


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#16347, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAWfoUi9mkGzsiLGmUnIBLcUj4R7CJupks5r-zUsgaJpZM4Npo7f
.

--

  • Michael Please pardon any errors, this message was sent from my iPhone.
avatar tonypartridge
tonypartridge - comment - 29 May 2017

The fact your server cannot verify the gmail SSL Certificate would suggest it's not a CMS issue, but more an issue with your connect to the remote server. Either the SSL is being tampered with for inspection or your server cannot connect to the verification server?

avatar joomla-cms-bot joomla-cms-bot - change - 29 May 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 29 May 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 30 May 2017
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 30 May 2017
Category com_plugins
avatar tonypartridge
tonypartridge - comment - 30 May 2017

Please contact your host, a quick google shows it's an issue with your CA being out of date. See:
https://help.github.com/articles/error-ssl-certificate-problem-verify-that-the-ca-cert-is-ok/

avatar franz-wohlkoenig franz-wohlkoenig - change - 30 May 2017
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2017-05-30 07:31:40
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 30 May 2017
The description was changed
Status Closed Discussion
avatar joomla-cms-bot joomla-cms-bot - edited - 30 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 30 May 2017
Status Discussion Closed
Closed_Date 2017-05-30 07:31:40 2017-05-30 07:31:41
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 30 May 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 30 May 2017

closed as no Core Issue.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16347.

avatar joomla-cms-bot
joomla-cms-bot - comment - 30 May 2017
avatar wirecreative
wirecreative - comment - 15 Dec 2017

We had been using this manual code edit on a site to fix gmail-related SMTP errors, but the upgrade to Joomla 3.8 on our test site has re-broken our SMTP connectivity.

The patched file libraries\joomla\mail\mail.php no longer exists in Joomla 3.8.
This function has been moved to \libraries\src\Mail\Mail.php line 642. It appears that the same patch works here as it did in the other file in previous Joomla versions.

avatar edthenet
edthenet - comment - 6 Apr 2020

I'm on Joomla! 3.9.16 now and the information can be found on line 654 of the file \libraries\src\Mail\Mail.php.

I have changed the file according to the information of #mbabker.
It still doesn't work for me.
I am trying to use Office365 SMTP mail, but i cannot send any mail if the settings are correct

Add a Comment

Login with GitHub to post a comment