Bug #33292 | Unable to connect using SSL (mysql 5.0.51, FreeBSD 6.2, OpenSSL 0.9.7e-p1) | ||
---|---|---|---|
Submitted: | 17 Dec 2007 16:09 | Modified: | 7 Feb 2008 7:45 |
Reporter: | Christian Karg | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server: General | Severity: | S2 (Serious) |
Version: | 5.0.51 | OS: | FreeBSD (6.2-STABLE) |
Assigned to: | Magnus Blåudd | CPU Architecture: | Any |
Tags: | SSL |
[17 Dec 2007 16:09]
Christian Karg
[19 Dec 2007 0:35]
Patrick Mackinlay
I can confirm that this issue is affecting our servers too.
[19 Dec 2007 9:44]
Arkadiusz Miskiewicz
I can confirm that this happens for me, too (Linux).
[19 Dec 2007 14:27]
Arkadiusz Miskiewicz
Patch fixing the issue (SSL handshake needs to explictly know if it's connect or accept)
Attachment: mysql-ssl.patch (application/octet-stream, text), 480 bytes.
[19 Dec 2007 21:49]
Susanne Ebrecht
Many thanks for writing a bug report. I can't reproduce this behaviour. $ ./bin/mysql --ssl=1 --ssl-ca=/usr/home/miracee/newcerts/ca-cert.pem --ssl-cert=/usr/home/miracee/newcerts/server-cert.pem --ssl-key=/usr/home/miracee/newcerts/server-key.pem Welcome to the MySQL monitor. ... ... mysql> select version()\G *************************** 1. row *************************** version(): 5.0.51-debug 1 row in set (0.00 sec) $ uname -a FreeBSD myhost 7.0-CURRENT-200703 FreeBSD 7.0-CURRENT-200703 #0: Tue Mar 6 22:35:04 UTC 2007 $ openssl version OpenSSL 0.9.8d 28 Sep 2006 I installed MySQL from source and OpenSSL from ports. Please, consider that we don't support packages/ports that are made from the distributor. We only support the packages, that you can download from our websites. Please, upate your OpenSSL, install MySQL 5.0.51 from our download sites and let us know, if the error still occurs.
[19 Dec 2007 22:43]
Norbert Tretkowski
I'm able to reproduce this problem on Debian with MySQL 5.0.51 compiled using --without-openssl and --with-yassl.
[20 Dec 2007 21:35]
Al Smith
I'm also able to reproduce this; ./configure --with-vio --with-openssl Without the patch in previous comments, we had the following matrix of connectivity success using SSL. c\s | 45 | 51 ----+----+---- 45 | ok |fail 51 |fail|fail With the patch applied, client 5.0.51 _was_ now able to connect to server 5.0.45. However, client 5.0.51 was still not able to connect to server 5.0.51: c\s | 45 | 51 ----+----+---- 45 | ok |fail 51 | ok |fail
[20 Dec 2007 22:08]
Arkadiusz Miskiewicz
updated version that handles server side, too (not tested; please test and share with results)
Attachment: mysql-ssl.patch (application/octet-stream, text), 1.51 KiB.
[22 Dec 2007 17:54]
Al Smith
Aye, worked like a charm. 51->51 connects without any problems now. c\s | 45 | 51 ----+----+---- 45 | ok | ok 51 | ok | ok Thanks !
[8 Jan 2008 21:30]
Kamil Kaczkowski
Arkadiusz's patch fixed our ssl problem too(5.0.56 client against 4.1.24 server). Thanks!
[9 Jan 2008 15:57]
Susanne Ebrecht
I tried a lot to reproduce this. I used MySQL 5.0.45, 5.0.51 and the 5.0.56 source tree from our source repository. Neither with Linux nor with FreeBSD I can reproduce this behaviour. I tried all compination of replication like: 5.0.45 as master and 5.0.51 as slave, 5.0.51 as master and slave, 5.0.51 as master and 5.0.45 as slave, and all combinations with 5.0.56 and 5.0.45. SSL works fine with all. I used OpenSSL 0.9.8d 28 Sep 2006. Maybe your certifications will occur the problem. Also most of you seems to use not supported packages. Consider, that we don't support packages/ports that are made from the distributor. We only support the packages and source code, that you can download from our websites. Please update your openssl version and install our supported source code. Also check your certificates.
[9 Jan 2008 16:18]
Arkadiusz Miskiewicz
OpenSSL documentation says: "SSL_do_handshake() will wait for a SSL/TLS handshake to take place. If the connection is in client mode, the handshake will be started. The handshake routines may have to be explicitly set in advance using either SSL_set_connect_state(3) or SSL_set_accept_state(3)." Now it says "may have to be explictly set". Looks like for us we have to explictly set it [1] while you Susanne don't. Why? That requires looking into OpenSSL source code to see which case happens when. 1. See reporter error, it's clear: error: OpenSSL: error:140B4090:SSL routines:SSL_do_handshake:connection type not set:/usr/src/secure/lib/libssl/../../../crypto/openssl/ssl/ssl_lib.c:1819: See for more: http://www.openssl.org/docs/ssl/SSL_do_handshake.html http://www.openssl.org/docs/ssl/SSL_set_connect_state.html#
[14 Jan 2008 23:17]
Patrick Mackinlay
My client is the "mysql-server-5.0.45_1" port running on FreeBSD 6.2 using only the default settings. My server is the mysql 5.0.51 source release compiled on FreeBSD 4.10 and configured with "./configure --with-openssl" (ports no longer works on FreeBSD 4.10). My server also has the "openssl-0.9.8e" port installed, but I assume the build will have used the openssl version that comes with the OS instead of the port (the client machine has no openssl port installed). Using Arkadiusz Miskiewicz patch on the server fixes all the problems for me. Let me know if you need any more info. regards, Patrick
[7 Feb 2008 7:45]
Magnus Blåudd
Duplicate of BUG#33050, only occurs when MySQL is compiled to use the OpenSSL library