Page 1 of 1

SSL Settings and Custom String

Posted: Thu 25 Sep 2014 00:22
by JFDMG
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

Re: SSL Settings and Custom String

Posted: Fri 26 Sep 2014 06:25
by ViktorV
dbexpmysql.dll is the standard MySQL driver. You can download our driver from http://www.devart.com/dbx/mysql/download.html

Re: SSL Settings and Custom String

Posted: Sat 27 Sep 2014 23:12
by JFDMG
ops... wrong DLL name...

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

Thanks

--
Jackson

Re: SSL Settings and Custom String

Posted: Mon 29 Sep 2014 13:01
by ViktorV
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.

Re: SSL Settings and Custom String

Posted: Fri 31 Oct 2014 07:46
by Kupe3
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

Re: SSL Settings and Custom String

Posted: Fri 31 Oct 2014 09:39
by ViktorV
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.

Re: SSL Settings and Custom String

Posted: Fri 12 Aug 2016 22:01
by dsonnet
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 ....

Re: SSL Settings and Custom String

Posted: Tue 16 Aug 2016 07:12
by ViktorV
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.

Re: SSL Settings and Custom String

Posted: Mon 21 Nov 2016 13:43
by ViktorV
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';