php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70063 Backronym fix breaks mysqlnd connection when configured without SSL
Submitted: 2015-07-13 12:10 UTC Modified: -
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: dominic dot benson at thirdlight dot com Assigned:
Status: Open Package: MySQL related
PHP Version: 5.4.43 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dominic dot benson at thirdlight dot com
New email:
PHP Version: OS:

 

 [2015-07-13 12:10 UTC] dominic dot benson at thirdlight dot com
Description:
------------
The 5.4 patch for #69669 (https://bugs.php.net/patch-display.php?bug_id=69669&patch=backronym-5.4&revision=1436080071&display=1) causes a regression in mysqlnd whereby if MYSQLND_SSL_SUPPORTED is not defined, attempting to connect results in a 'Packets out of order' error.

This is because the patch introduces a new #else to the check, which calls PACKET_WRITE.
This affects the MySQL and MySQLi extensions when using mysqlnd.

The attached patch corrects this, and emits an E_WARNING if the CLIENT_SSL flag is set but cannot be honoured, rather than silently squashing it (which seemed rather contrary to the original purpose of the change). FWIW, I would probably advocate simply refusing to connect at all under those circumstances, but that is perhaps a more contentious change.


Test script:
---------------
<?php
mysql_connect();
mysqli_connect();

Expected result:
----------------
(No output)

Actual result:
--------------
PHP Warning:  Packets out of order. Expected 3 received 2. Packet size=22 in - on line 2
PHP Warning:  mysql_connect(): MySQL server has gone away in - on line 2
PHP Warning:  mysql_connect(): MySQL server has gone away in - on line 2
PHP Warning:  Packets out of order. Expected 3 received 2. Packet size=22 in - on line 3
PHP Warning:  mysql_connect(): MySQL server has gone away in - on line 3
PHP Warning:  mysql_connect(): MySQL server has gone away in - on line 3


Patches

mysql-client-ssl-handling-when-disabled.patch (last revision 2015-07-13 12:11 UTC by dominic dot benson at thirdlight dot com)

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Nov 22 12:01:24 2019 UTC