Advertisement:

Author Topic: Update to 3.7.3 - stream_socket_enable_crypto() Error  (Read 2361 times)

Aficionado

  • Guest
Update to 3.7.3 - stream_socket_enable_crypto() Error
« on: April 27, 2017, 04:27:30 pm »
I see this many times in my debug.log after 3.7.3 (each time an email is trying to send).

[26-Apr-2017 21:56:43 America/Los_Angeles] PHP Warning:  stream_socket_enable_crypto(): Peer certificate CN=`*.myprovider.com' did not match expected CN=`mail.mydomain.com' in /home/public_html/oc-includes/phpmailer/class.smtp.php on line 367

It seems that no email is send anymore.

Keep in mind that there were NO errors with 3.7.1 in this.
« Last Edit: April 27, 2017, 04:53:04 pm by Aficionado »

_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4689
Re: Update to 3.7.3 - stream_socket_enable_crypto() Error
« Reply #1 on: April 27, 2017, 06:26:59 pm »
Looks like some issue with your certificates. The security was "increased" in recent versions of phpmailer and php itself. It's more strict with certificates.

You could try to modify oc-includes/osclass/utils.php lines 449-451  from

Code: [Select]
    $mail->IsHTML(true);

    $mail = osc_apply_filter('pre_send_mail', $mail, $params);


to

Code: [Select]
    $mail->IsHTML(true);
      $mail->SMTPOptions = array (
        'ssl' => array(
            'verify_peer'  => false,
            'verify_peer_name'  => false,
            'allow_self_signed' => true));
    $mail = osc_apply_filter('pre_send_mail', $mail, $params);

to avoid certificare verificatin, which is what looks to be failing here.

which version of PHP are you using?

Aficionado

  • Guest
Re: Update to 3.7.3 - stream_socket_enable_crypto() Error
« Reply #2 on: April 27, 2017, 06:32:33 pm »
I'm using PHP 7.0.18. As for issues with my certificate, i don't see any. What should i look for ?

Also it was working great with 3.7.1 and i just updated to 3.7.3 and changed nothing else.

I will not modify anything yet in code. What i will do is change my smtp of Osclass from "mail.mydomain.com" directly to use my provider's. And i will report back if it works.

Also i will wait until others with SSL update and see if it works for them.

I will update in a few hours.




_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4689
Re: Update to 3.7.3 - stream_socket_enable_crypto() Error
« Reply #3 on: April 27, 2017, 06:40:01 pm »
The issue here is that you are trying to connect to mail.mydomain.com but the certificate is from yourprovider.com

In previous versions of phpmailer (which was updated in osclass) the certificate wasn't checked, now it is and it fails. Connect directly to the domain of your provider or ask them to issue a certificate on your behalf.

Aficionado

  • Guest
Re: Update to 3.7.3 - stream_socket_enable_crypto() Error
« Reply #4 on: April 27, 2017, 06:43:13 pm »
Daniel, i use Wordpress on the same plan, SSLed, without a single problem.

I also changed now to my provider's mail (because all my email stopped and i can't have that) and also it doesn't work (opens thousand of connections to the db and crashes my connection).

I have a certificate working, so not sure what you mean to ask about.

_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4689
Re: Update to 3.7.3 - stream_socket_enable_crypto() Error
« Reply #5 on: April 27, 2017, 06:52:26 pm »
We're talking about the certificates of your email server. If you are using some sort of managed hosting service, it's usually a different server than the one your files are.

For example in Dreamhost you could connect to the email server via mail.yourdomain.com or something like sub4.mail.dreamhost.com that server is independent of your files one, and the certificate is different too.

The problem (from what you posted here), is that you try to connect to mail.yourdomain.com but the email server's certificate is for mail.yourprovider.com which is different. With the modification I told you, you disable certificate verification, ie, it should work even if the domain is different. But the solution is not to disable it, but to provide a valid certificate, ie, that your email server offers a certificate on behalf of mail.yourdomain.com

Wordpress may have disabled certificate verification in their code and that's maybe the reason why it works there.


Also, I thought we were talking about emails not being sent, if you have another issues, please explain too, because email has nothing to do with database connections.

Aficionado

  • Guest
Re: Update to 3.7.3 - stream_socket_enable_crypto() Error
« Reply #6 on: April 27, 2017, 07:02:19 pm »
I tried to use the provider's mail in the smtp settings, instead of mine. That created a HAVOC and crashed everything due to:

[27-Apr-2017 10:35:51 America/Indiana/Indianapolis] PHP Warning:  mysqli::__construct(): (42000/1203): User mydomain already has more than 'max_user_connections' active connections in /home/public_html/oc-includes/osclass/classes/database/DBConnectionClass.php on line 459

[27-Apr-2017 10:35:51 America/Indiana/Indianapolis] PHP Warning:  DBConnectionClass::errorReport(): Couldn't fetch mysqli in /home/public_html/oc-includes/osclass/classes/database/DBConnectionClass.php on line 192

So that failed.

Now certificate for my mail server is a new to me. I'm on shared hosting.

I have opened a ticket to my hoster and see what they will reply.

But again, why a simple update would ruin things, i don't get it. I NEVER had any email problem with them. I run 5 Osclass (now all without email) and several Wordpress. ALL SSLed.

I will keep updated here when they reply to me.

Aficionado

  • Guest
Re: Update to 3.7.3 - stream_socket_enable_crypto() Error
« Reply #7 on: April 28, 2017, 01:38:27 am »
Ok, it seems that the problem was not (directly) related to Osclass 3.7.3.

I had to remove and re-issue all SSL certificates to make things work. I would say it was a problem of Cpanel or something but my SSL Osclass sites were working and sending email from the day i installed SSL without any problem.

Something changed in 3.7.3 or became stricter and that caused some problem, not sure what.

Anyway, thanks for the help.

 8)

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: Update to 3.7.3 - stream_socket_enable_crypto() Error
« Reply #8 on: April 29, 2017, 05:11:31 pm »
I remember having the exact same issue few months ago in one test system (shared hosting), when phpmailer patch was still in testing branch, but the problem was resolved simply by replacing generic hostname (e.g. "localhost") with a proper one. There's no need to regenerate certificates.

Usually, you will see it already as some path where your shared hosting node actually is (someserver01.cpanel.something.com), or just ask your hosting support to tell you, if you don't know.

uve

  • Newbie
  • *
  • Posts: 26
Re: Update to 3.7.3 - stream_socket_enable_crypto() Error
« Reply #9 on: May 09, 2017, 09:03:11 pm »
Hi, I have the same problem after update ocslass too 3.7.3.
Can you explain me how to fix it, how remove and re-issue SSL certiffcates?
I use Direct Admin panel.

Aficionado

  • Guest
Re: Update to 3.7.3 - stream_socket_enable_crypto() Error
« Reply #10 on: May 09, 2017, 09:11:34 pm »
Hi, I have the same problem after update ocslass too 3.7.3.
Can you explain me how to fix it, how remove and re-issue SSL certiffcates?
I use Direct Admin panel.

Hi,

I have no idea what Direct Admin is, so probably i can't help.

What i did was with Cpanel's SSL module, i removed my SSL and re-added. Nothing else.

uve

  • Newbie
  • *
  • Posts: 26
Re: Update to 3.7.3 - stream_socket_enable_crypto() Error
« Reply #11 on: May 09, 2017, 11:14:20 pm »
I understand, unfortunately I don't have access to SSL on my hosting.
But now I saw that I have a little different error from you:

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 in /home/gielda/domains/mydomain.com/public_html/oc-includes/phpmailer/class.smtp.php on line 367

Warning: Cannot modify header information - headers already sent by (output started at /home/gielda/domains/mydomain.com/public_html/oc-includes/osclass/utils.php:1738) in /home/gielda/domains/mydomain.com/public_html/oc-includes/osclass/utils.php on line 1743

Can anyone help me?

Aficionado

  • Guest
Re: Update to 3.7.3 - stream_socket_enable_crypto() Error
« Reply #12 on: May 10, 2017, 12:35:31 am »
The second error (header modify error) usually is due to code changes you did (did you?) and extra white spaced introduced. Not always, but usually.

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: Update to 3.7.3 - stream_socket_enable_crypto() Error
« Reply #13 on: May 15, 2017, 02:09:26 pm »
@ uve

1st error is related to your SSLs and Email server config @ Osclass admin dashboard, as I answered in another topic, contact h-support.
2nd issue already answered by Aficionado, search forum a little for solution(s).