Can"t connect to MySQL using SSL

Can"t connect to MySQL using SSL

am 01.09.2007 11:03:54 von Santo Leto

------=_NextPart_000_0029_01C7EC87.C92F9F70
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Hello List.

I've the same problem described in =
http://forums.mysql.com/read.php?37,169713,169713#msg-169713

Indeed, I've a running MySQL Server on Windows with SSL support (i.e. =
HAVE_OPENSSL =3D YES).
I can connect with a ssl user using my certificates:

mysql =
--defaults-file=3D"C:\Programmi\MySQL\mysql-5.1.20-beta-win3 2\my-small-ss=
l.ini" -P 5120 -ussl -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 39
Server version: 5.1.20-beta-community-nt-debug-log MySQL Community =
Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> \s
--------------
mysql Ver 14.13 Distrib 5.1.20-beta, for Win32 (ia32)

Connection id: 39
Current database:
Current user: ssl@localhost
SSL: Cipher in use is DHE-RSA-AES256-SHA
Using delimiter: ;
Server version: 5.1.20-beta-community-nt-debug-log MySQL =
Community Serve
r (GPL)
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
TCP port: 5120
Uptime: 22 hours 35 min 56 sec

Threads: 1 Questions: 224 Slow queries: 0 Opens: 101 Flush tables: 1 =
Open t
ables: 1 Queries per second avg: 0.2
--------------

Also, I can connect using the API:

mysql_ssl_set
mysql_real_connect

The problem is when I try to connect using MyODBC 3.51.19 with the same =
parameters used with API and command line connections.

If I use the MyODBC GUI setup dialog:

SSL KEY: C:\OpenSSL\client-key.pem
SSL CERTIFICATE: C:\OpenSSL\client-cert.pem
SSL CERTIFICATE AUTHORITY: C:\OpenSSL\ca-cert.pem
SSL CA PATH: C:\OpenSSL\
SSL CIPHER: DHE-RSA-AES256-SHA

the ODBC Manager gives me the following error:

Request returned with SQL_ERROR

Also, if I try to connect with ADO:

ConnectionString =3D "DRIVER=3D{MySQL ODBC 3.51 Driver};" _
& "SERVER=3Dlocalhost;" _
& "DATABASE=3Ddatabase1;" _
& "UID=3Dssl;" _
& "PWD=3D;" _
& "SSLCA=3DC:\OpenSSL\ca-cert.pem;" _
& "SSLCAPATH=3DC:\OpenSSL;" _
& "SSLCERT=3DC:\OpenSSL\client-cert.pem;" _
& "SSLCIPHER=3DDHE-RSA-AES256-SHA;" _
& "SSLKEY=3DC:\OpenSSL\client-key.pem;" _
& "PORT=3D5120;" _
& "OPTION=3D" & 2 + 3 + 8 + 32 + 2048 + 16384


a "SSL Connection Error" is returned.

Venu, Jim,
your help is much appreciated.

Thank you, Santo Leto.
=20


------=_NextPart_000_0029_01C7EC87.C92F9F70--

Re: Can"t connect to MySQL using SSL

am 08.11.2007 22:41:01 von malco95

I´ve the same problem...
but I use MySQL ODBC 5.1 Driver and Mysql server 5 over Windows 2003 server

I create certificates how to...
http://dev.mysql.com/doc/refman/5.0/en/secure-create-certs.h tml

and see the forum mysql in:
http://forums.mysql.com/read.php?35,39354,49575#msg-49575

but not work...
WHAT IS THE TIP!!!!
thanks...=20
malco



Santo Leto wrote:
>=20
>=20
> Hello List.
>=20
> I've the same problem described in
> http://forums.mysql.com/read.php?37,169713,169713#msg-169713
>=20
> Indeed, I've a running MySQL Server on Windows with SSL support (i.e.
> HAVE_OPENSSL =3D YES).
> I can connect with a ssl user using my certificates:
>=20
> mysql
> --defaults-file=3D"C:\Programmi\MySQL\mysql-5.1.20-beta-win3 2\my-small-ss=
l.ini"
> -P 5120 -ussl -p
> Enter password:
> Welcome to the MySQL monitor. Commands end with ; or \g.
> Your MySQL connection id is 39
> Server version: 5.1.20-beta-community-nt-debug-log MySQL Community Server
> (GPL)
>=20
> Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
>=20
> mysql> \s
> --------------
> mysql Ver 14.13 Distrib 5.1.20-beta, for Win32 (ia32)
>=20
> Connection id: 39
> Current database:
> Current user: ssl@localhost
> SSL: Cipher in use is DHE-RSA-AES256-SHA
> Using delimiter: ;
> Server version: 5.1.20-beta-community-nt-debug-log MySQL Communit=
y
> Serve
> r (GPL)
> Protocol version: 10
> Connection: localhost via TCP/IP
> Server characterset: latin1
> Db characterset: latin1
> Client characterset: latin1
> Conn. characterset: latin1
> TCP port: 5120
> Uptime: 22 hours 35 min 56 sec
>=20
> Threads: 1 Questions: 224 Slow queries: 0 Opens: 101 Flush tables: 1=
=20
> Open t
> ables: 1 Queries per second avg: 0.2
> --------------
>=20
> Also, I can connect using the API:
>=20
> mysql_ssl_set
> mysql_real_connect
>=20
> The problem is when I try to connect using MyODBC 3.51.19 with the same
> parameters used with API and command line connections.
>=20
> If I use the MyODBC GUI setup dialog:
>=20
> SSL KEY: C:\OpenSSL\client-key.pem
> SSL CERTIFICATE: C:\OpenSSL\client-cert.pem
> SSL CERTIFICATE AUTHORITY: C:\OpenSSL\ca-cert.pem
> SSL CA PATH: C:\OpenSSL\
> SSL CIPHER: DHE-RSA-AES256-SHA
>=20
> the ODBC Manager gives me the following error:
>=20
> Request returned with SQL_ERROR
>=20
> Also, if I try to connect with ADO:
>=20
> ConnectionString =3D "DRIVER=3D{MySQL ODBC 3.51 Driver};" _
> & "SERVER=3Dlocalhost;" _
> & "DATABASE=3Ddatabase1;" _
> & "UID=3Dssl;" _
> & "PWD=3D;" _
> & "SSLCA=3DC:\OpenSSL\ca-cert.pem;" _
> & "SSLCAPATH=3DC:\OpenSSL;" _
> & "SSLCERT=3DC:\OpenSSL\client-cert.pem;" _
> & "SSLCIPHER=3DDHE-RSA-AES256-SHA;" _
> & "SSLKEY=3DC:\OpenSSL\client-key.pem;" _
> & "PORT=3D5120;" _
> & "OPTION=3D" & 2 + 3 + 8 + 32 + 2048 + 16384
>=20
>=20
> a "SSL Connection Error" is returned.
>=20
> Venu, Jim,
> your help is much appreciated.
>=20
> Thank you, Santo Leto.
> =20
>=20
>=20
>=20

--=20
View this message in context: http://www.nabble.com/Can%27t-connect-to-MySQ=
L-using-SSL-tf4363968.html#a13656349
Sent from the MySQL - ODBC mailing list archive at Nabble.com.


--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=3Dgcdmo-myodbc@m.gmane.o rg