RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1228755 - openssl update breaks mysql ssl
Summary: openssl update breaks mysql ssl
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: mysql
Version: 6.7
Hardware: x86_64
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Jakub Dorňák
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 1232207 1272091
TreeView+ depends on / blocked
 
Reported: 2015-06-05 15:36 UTC by dukrat
Modified: 2019-08-15 04:40 UTC (History)
21 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
With certain versions of OpenSSL, using SSL to log into a MySQL client as root previously failed with a "ERROR 2026 (HY000): SSL connection error" message. This update increases the Diffie-Hellman (DH) key length in MySQL from 512 to 1024 bits, which meets the DH key length requirements for these OpenSSL versions. As a result, SSL can be used as expected in the described scenario.
Clone Of:
: 1231960 1232207 1272091 (view as bug list)
Environment:
Last Closed: 2015-10-22 09:31:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description dukrat 2015-06-05 15:36:25 UTC
Description of problem:
openssl 1.0.1e-30.el6_6.9 breaks mysql ssl for client and replication.  

Version-Release number of selected component (if applicable):
mysql-server.x86_64              5.1.73-3.el6_5 
openssl.x86_64                   1.0.1e-30.el6_6.9

How reproducible:
Occurred in 3/3 systems tested.  

Steps to Reproduce: (as root)
yum update; yum install mysql-server
vim /etc/my.cnf
  [mysqld]
  ssl-ca=/var/lib/mysql/mysqlcerts/ca-cert.pem
  ssl-cert=/var/lib/mysql/mysqlcerts/server-cert.pem
  ssl-key=/var/lib/mysql/mysqlcerts/server-key.pem
  [client]
  ssl-ca=/var/lib/mysql/mysqlcerts/ca-cert.pem
  ssl-cert=/var/lib/mysql/mysqlcerts/client-cert.pem
  ssl-key=/var/lib/mysql/mysqlcerts/client-key.pem
  mkdir /var/lib/mysql/mysqlcerts
  cd /var/lib/mysql/mysqlcerts
  openssl genrsa 2048 > ca-key.pem
  openssl req -new -x509 -nodes -days 1000 -key ca-key.pem -out ca-cert.pem
  openssl req -newkey rsa:2048 -days 1000 -nodes -keyout server-key.pem -out server-req.pem
  openssl rsa -in server-key.pem -out server-key.pem
  openssl x509 -req -in server-req.pem -days 1000  -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 -out server-cert.pem
  openssl req -newkey rsa:2048 -days 1000 -nodes -keyout client-key.pem -out client-req.pem
  openssl rsa -in client-key.pem -out client-key.pem
  openssl x509 -req -in client-req.pem -days 1000 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 -out client-cert.pem
  chown mysql:mysql *
  chmod 640 *
  service mysql restart

Actual results:
ERROR 2026 (HY000): SSL connection error

Expected results:
Logged into mysql as root.  

Additional info:
Other clients seem to be able to connect so the server is likely still functioning but the mysql client and replication are not.

Comment 2 Tomas Mraz 2015-06-08 09:52:25 UTC
MySQL server hardcodes 512 bit DH parameters which is severally insecure. See CVE-2015-4000 aka LOGJAM vulnerability. It needs to be fixed to use at least 1024 bit parameters or better.

You should be able to workaround the issue via the --ssl-cipher option. Set it to something like 'DEFAULT:!EDH:!DHE' to disable the DH key exchange method.

Comment 3 Tomas Mraz 2015-06-08 10:36:02 UTC
Note that the code hardcoding the parameters is in:
vio/viosslfactories.c - function new_VioSSLFd()

  /* DH stuff */
  dh=get_dh512();
  SSL_CTX_set_tmp_dh(ssl_fd->ssl_context, dh);
  DH_free(dh);

These should be at least 1024 bit DH parameters or even better 2048 bits.

Comment 4 Tomas Hoger 2015-06-08 10:53:45 UTC
This does not seem to be fixed in MySQL or MariaDB upstream.  There is Red Hat / Fedora specific patch to update to 1024, see e.g.:

http://pkgs.fedoraproject.org/cgit/community-mysql.git/tree/community-mysql-dh1024.patch
https://git.centos.org/blob/rpms!mariadb.git/37edda9/SOURCES!mariadb-dh1024.patch

Comment 5 Tomas Hoger 2015-06-08 21:28:26 UTC
MySQL and Percona Server bug reports:

http://bugs.mysql.com/bug.php?id=77275
https://bugs.launchpad.net/percona-server/+bug/1462856

This issue was already fixed in MariaDB 10.0.18, but the fix does not seem to be applied to 5.5 yet.

https://mariadb.atlassian.net/browse/MDEV-7695
https://github.com/MariaDB/server/commit/7e7dd8e
https://mariadb.com/kb/en/mariadb/mariadb-10018-changelog/

Comment 6 Tomas Hoger 2015-06-08 21:35:24 UTC
As noted in comment 2, a work around is to disable DH cipher suites on server or client side using --ssl-cipher option.  This option can be specified on the command line, or in my.cnf configuration file.

Server side configuration in /etc/my.cnf may look as:

[mysqld]
ssl-cipher=DEFAULT:!DH

Client side configuration in /etc/my.cnf or ~/.my.cnf may look as:

[mysql]
ssl-cipher=DEFAULT:!DH

Comment 9 Tomas Hoger 2015-06-09 11:14:31 UTC
Fixed also in MySQL development version 5.7 in 5.7.6:

https://github.com/mysql/mysql-server/commit/866b988a76e8e7e217017a7883a52a12ec5024b9
http://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-6.html

This fix updates DH params to 2048bits rather than 1024bits.

Comment 13 Erinn Looney-Triggs 2015-06-12 16:12:06 UTC
MariaDB 5.5 in software collections seems to be susceptible to the same issue, just FYI.

Comment 14 Tomas Hoger 2015-06-12 17:24:25 UTC
MariaDB 5.5 in Software Collections already includes patch that makes it use 1024bit DH parameters, so it should not be affected.  I just quickly tested with:

mariadb55-mariadb-5.5.41-12.el6.x86_64
openssl-1.0.1e-30.el6_6.9.x86_64

Connections using DH cipher worked fine.

Please provide versions you're using.

Comment 35 Tomas Hoger 2015-06-25 19:54:27 UTC
Note that mysql packages update addressing this issue was already released:

https://rhn.redhat.com/errata/RHBA-2015-1129.html


Note You need to log in before you can comment on or make changes to this bug.