can't connect using SSL cert files

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for MySQL in Delphi and C++Builder
Post Reply
kire_z
Posts: 1
Joined: Sat 29 Jul 2017 13:17

can't connect using SSL cert files

Post by kire_z » Sat 29 Jul 2017 14:00

Hello,

I am trying to migrate an old delphi7 app from using mysql4 to mysql5.

Back in times, I was using microolap dbx4mysql dbxdriver which is deprecated for long now, so I am trying your latest version of the dbxdriver, but I get these errors when I try to connect to the server

Image Image

i tried putting different versions of the libeay32.dll and ssleay32.dll in the app folder, but I get the same results. The only difference is that sometimes I get error 0 and sometimes -1.

I checked Microsoft ProcessMonitor to make sure my project is loading the DLL files from the app folder.

Navicat and MySQLWorkbench connect fine using the same user/password and same cert files.

Below is my code. According to your documentation, everything should be ok, but it doesn't work. Can you please tell me what may be wrong?

Code: Select all

procedure TForm1.Button2Click(Sender: TObject);
begin
	SQLConnection.DriverName := 'DevartMySQLDirect';
	SQLConnection.LibraryName := 'dbexpmda.dll'; 
	SQLConnection.VendorLib := 'not used';
	SQLConnection.GetDriverFunc := 'getSQLDriverMySQLDirect';
	SQLConnection.Params.Clear;

	SQLConnection.Params.Add('Custom String=Protocol=SSL');

	SQLConnection.Params.Values['HostName']:='1.2.3.4:3307';
	SQLConnection.Params.Values['Database']:='mydb';
	SQLConnection.Params.Values['User_name']:='dbuser';
	SQLConnection.Params.Values['Password']:='mypsw';

	SQLConnection.Params.Values['SSLCACert'] := 'd:\test-certs\ca-cert.pem';
	SQLConnection.Params.Values['SSLCert'] :=   'd:\test-certs\client-test-cert.pem';
	SQLConnection.Params.Values['SSLKey'] :=    'd:\test-certs\client-test-key.pem';

	SQLConnection.Params.Values['SSLCipherList'] := 'ALL';

	SQLConnection.Open;
end;
additional info:
- SSL version : TLS v1.1
- DB version : 5.5.52-MariaDB
- SSL cipher : DHE-RSA-AES256-SHA

Thank you in advance

ViktorV
Devart Team
Posts: 2388
Joined: Wed 30 Jul 2014 07:16

Re: can't connect using SSL cert files

Post by ViktorV » Mon 07 Aug 2017 09:22

When investigating we found that this issue is related to the fact that in Delphi 7 the limitations of the dbExpress architecture, some parameters are not applied, in this case the parameters for establishing SSL connection. We are investigating the possibility to workaround this limitation of dbExpress.

Post Reply