MySQL, BCB6 ans SSL Connection

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
JonKerry

MySQL, BCB6 ans SSL Connection

Post by JonKerry » Wed 15 Mar 2006 17:35

I am having trouble connecting to a Fedora Linux Server which is SSL enabled.

As far as I know everything is correctly configured both on the client and server side, but i keep getting a libmysql.dll client library error.

How can this be solved

Many Thanks

Jon

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Thu 16 Mar 2006 11:22

Try downloading last build of MyDAC. If problem persists send us following information:
- Exact version of Delphi, C++ Builder or Kylix
- Exact version of MyDAC. You can see it in About sheet of TMyConnection Editor
- Exact version of MySQL server and MySQL client. You can see it in Info sheet of TMyConnection

JonKerry

Post by JonKerry » Thu 16 Mar 2006 14:14

I am currently running 4.30.0.11 and am getting

MySQL API function is not linked. You should update MySQL client library (libmysql.dll)

I have MySQL 5.0.18 running on Fedora Linux Server
The client is on Win XP with BCB 6

The component works fine without the SSL option but not with it

I have tested the server with Navicat and that works fine

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Fri 17 Mar 2006 12:19

Most possibly you have old client library or client library that doesn't support SSL connection. Have you tried connecting in direct mode?

JonKerry

Post by JonKerry » Fri 17 Mar 2006 12:23

Direct = True seems to work fine

I have moved libmysql.dll into the exe location also.

I made sure that this was the windows equvilant of the Linux server version by downloading the win32 mysql server and retrieving the dll from that installation

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Fri 17 Mar 2006 16:25

We advise you using Direct = True or, if you have any essential reasons not to use this mode, find client library that works well with SSL.

JonKerry

Post by JonKerry » Fri 17 Mar 2006 16:57

For security reasons I cont use Direct = True because I require encryption

Which client library will work with the MyDac 4.30.0.11 component?

Thanks

Jon

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 20 Mar 2006 09:37

> For security reasons I cont use Direct = True because I require encryption
Direct option doesn't affect using encryption.

> Which client library will work with the MyDac 4.30.0.11 component?
3.23, 4.0, 4.1, 5.0

JonKerry

Post by JonKerry » Mon 20 Mar 2006 14:14

When I connect with Direct = True and using SSL I get the following error

Assertion Failure (D:\Projects\Delphi\Mydac\Source\MySqlVioTcpSSL.pas, line 87)

I am using MySQL server version 5.0.18

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 21 Mar 2006 07:45

Unfortunately we couldn't reproduce the problem. Please send us (mydac*crlab*com) a complete small sample to demonstrate it.

JonKerry

Post by JonKerry » Tue 21 Mar 2006 17:35

I would guess that you dont get the error because you will have the required pas file in the correct place

what do u need me to send to show the error?

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 22 Mar 2006 13:52

Pas file doesn't matter. We tested SSL connection using the same installation package as you use.
Some time ago you wrote:
Direct = True seems to work fine
But now you report that direct connection fails. Please set the settings you used before and try again.

JonKerry

Post by JonKerry » Wed 22 Mar 2006 14:17

Direct = True works fine when using the default configuration

However I required an SSL connection when Direct = True with this i get the .pas error, when i set Direct = False i get the libmysql.dll error

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 22 Mar 2006 16:40

We connect to the MySQL Server with SSL support using following parameters:

a)settings in my.ini:

Code: Select all

    port		= 3312 
    ssl-ca=D:/Program Files/MySQL/MySQL41_SSL/bin/cert/ca-cert.pem
    ssl-cert=D:/Program Files/MySQL/MySQL41_SSL/bin/cert/SSL-server-cert.pem
    ssl-key=D:/Program Files/MySQL/MySQL41_SSL/bin/cert/SSL-server-key.pem 
b)Command to start MySQL server:

Code: Select all

    D:\Program Files\MySQL\MySQL41_SSL\bin>start mysqld.exe --defaults-file=my.ini
c)Command to add user with SSL support

Code: Select all

    GRANT ALL PRIVILEGES ON *.* TO 'UserName'@'UserHost' IDENTIFIED BY 'passw'  REQUIRE ssl;

d)MyConnection options definition:

Code: Select all

  object MyConnection1: TMyConnection
    Database = 'test'
    Port = 3312
    Options.Protocol = mpSSL
    SSLOptions.CACert = 'D:\Program Files\MySQL\MySQL41_SSL\bin\cert\ca-cert.pem'
    SSLOptions.Key = 'D:\Program Files\MySQL\MySQL41_SSL\bin\cert\SSL-client-key.pem'
    SSLOptions.Cert = 'D:\Program Files\MySQL\MySQL41_SSL\bin\cert\SSL-client-cert.pem'
    Username = 'UserName'
    Password = 'passw'
    Server = 'UserHost'
  end
Please compare these settings with your ones.

JonKerry

Post by JonKerry » Wed 22 Mar 2006 17:10

Still no change

I am sure that the server is setup correctly because Navicat is able to connect successfully to it using the certificates and username

MyDAC also seems to connect successfully without SSL

Which version of MYSQL are you using? From the code you have sent I am guessing a win32 one.

Post Reply