SSL Settings and Custom String

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for MySQL in Delphi and C++Builder
Post Reply
JFDMG
Posts: 2
Joined: Thu 25 Sep 2014 00:13

SSL Settings and Custom String

Post by JFDMG » Thu 25 Sep 2014 00:22

Hey guys:

We're using version 6.0.1.0 (dbexpmysql.dll) and we need to setup SSL using parameters, as we use the DLL only. We use the "Custom String" option:

'Custom string=UseSSL=true,"ClientCertificate='+aSSLCert+'","ClientKey='+aSSLKey+'"'

My Question is: what is the custom parameter name for

* ssl ca certificate
* Cypher

Thanks in advance.

--
Jackson Gomes / Flow Software

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

Re: SSL Settings and Custom String

Post by ViktorV » Fri 26 Sep 2014 06:25

dbexpmysql.dll is the standard MySQL driver. You can download our driver from http://www.devart.com/dbx/mysql/download.html

JFDMG
Posts: 2
Joined: Thu 25 Sep 2014 00:13

Re: SSL Settings and Custom String

Post by JFDMG » Sat 27 Sep 2014 23:12

ops... wrong DLL name...

Question is still the same. Can you please answer it regarding your product?

Thanks

--
Jackson

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

Re: SSL Settings and Custom String

Post by ViktorV » Mon 29 Sep 2014 13:01

To setup SSL connection to MySQL server, use the following code:

Code: Select all

TSQLConnection.Params.Add('Custom String=Protocol=SSL'); 
TSQLConnection.Params.Add('SSLCACert=Pathname_to_the_certificate_authority_file');
TSQLConnection.Params.Add('SSLCert=Pathname_to_the_certificate_file');
TSQLConnection.Params.Add('SSLKey=Pathname_to_the_key_file'); 
TSQLConnection.Params.Add('SSLCipherList=All');
You can find more details in the Readme.html file at %DBXMySQL%\Readme.html ,
where %DBXMySQL% - the path to the installed dbExpress driver for MySQL.
Last edited by ViktorV on Mon 21 Nov 2016 13:44, edited 3 times in total.

Kupe3
Posts: 5
Joined: Sun 14 Dec 2008 12:29

Re: SSL Settings and Custom String

Post by Kupe3 » Fri 31 Oct 2014 07:46

Hi,
i am trying to connect to MySQL server through SSL connection, using your code:

Code: Select all

TSQLConnection.Params.Add('Custom String=Protocol=SSL'); 
TSQLConnection.Params.Add['SSLCACert=Pathname_to_the_certificate_authority_file'];
TSQLConnection.Params.Add['SSLCert=Pathname_to_the_certificate_file'];
TSQLConnection.Params.Add['SSLKey=Pathname_to_the_key_file']; 
TSQLConnection.Params.Add['SSLCipherList=All'];
But i get following error:
Image
Can you tell me what does it means and what may be the problem?

thanks

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

Re: SSL Settings and Custom String

Post by ViktorV » Fri 31 Oct 2014 09:39

This error is generated by the OpenSSL library.
For the problem investigation, please send a sample reproducing the problem to viktorv*devart*com, including certificates.

dsonnet
Posts: 2
Joined: Mon 23 Mar 2015 09:50

Re: SSL Settings and Custom String

Post by dsonnet » Fri 12 Aug 2016 22:01

Hi,

I'm experiencing exactly the same issue.

I can connect with SSL to my server with mysql workbench.

But with the same user / certs I have this error SSL_do_handshake = -1 ....

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

Re: SSL Settings and Custom String

Post by ViktorV » Tue 16 Aug 2016 07:12

This error is generated by OpenSSL library. This error may occur due to various reasons, e.g., usage of OpenSSL version that is not supported by MySQL server.
Please make sure you are using the latest version of dbExpress driver for MySQL (6.8.11). Also make sure that MySQL Workbench and your application use the same versions of OpenSSL libraries. To retrieve the path to the OpenSSL libraries, used by the application, you can use a third-party utility, e.g. Process Explorer.
If versions of OpenSSL libraries are different, please place the libraries used by MySQL Workbench to the directory with the executable file and check whether the error is reproduced. If it is reproduced, for the problem investigation, please send a sample reproducing the problem to viktorv*devart*com, including certificates and the used OpenSSL libraries.

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

Re: SSL Settings and Custom String

Post by ViktorV » Mon 21 Nov 2016 13:43

As you use MySQL server on Linux, you should specify a value of the SSLCipherList parameter in upper case. For example:

Code: Select all

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

Post Reply