Page 1 of 4
MySQL, BCB6 ans SSL Connection
Posted: Wed 15 Mar 2006 17:35
by JonKerry
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
Posted: Thu 16 Mar 2006 11:22
by Antaeus
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
Posted: Thu 16 Mar 2006 14:14
by JonKerry
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
Posted: Fri 17 Mar 2006 12:19
by Antaeus
Most possibly you have old client library or client library that doesn't support SSL connection. Have you tried connecting in direct mode?
Posted: Fri 17 Mar 2006 12:23
by JonKerry
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
Posted: Fri 17 Mar 2006 16:25
by Antaeus
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.
Posted: Fri 17 Mar 2006 16:57
by JonKerry
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
Posted: Mon 20 Mar 2006 09:37
by Antaeus
> 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
Posted: Mon 20 Mar 2006 14:14
by JonKerry
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
Posted: Tue 21 Mar 2006 07:45
by Antaeus
Unfortunately we couldn't reproduce the problem. Please send us (mydac*crlab*com) a complete small sample to demonstrate it.
Posted: Tue 21 Mar 2006 17:35
by JonKerry
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?
Posted: Wed 22 Mar 2006 13:52
by Antaeus
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.
Posted: Wed 22 Mar 2006 14:17
by JonKerry
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
Posted: Wed 22 Mar 2006 16:40
by Antaeus
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.
Posted: Wed 22 Mar 2006 17:10
by JonKerry
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.