UniDAC, Azure mySQL and SSL

Hello,

I am attempting to use UniDAC with DataAbstract to create a custom server to connect to a mySQL database on Azure with SSL.

I have set the appropriate driver information in the connection wizard but I get the following error:

SSL_do_handshake = -1
SSL_get_err(…,r2) = 1

Any suggestions? mySQL WorkBench works fine over SSL so I know that the SSL connection is ok.

can you connect to your database w/o DA? what steps are required?

Yes, I am able to connect using UniDAC by itself. I dropped a TUniConnection and set the following using the connection editor:

On Connect Tab:
Provider: MySQL
Server name was set to the Azure MySQL database server.
Port: 3306
Username and password were set correctly.
LoginPrompt was turned off (un-checked)
DBName was typed in correctly.

On Options tab:
Compress: True
Protocol: mpSSL

I saved the settings and set the TUniConnection’s Connected property to true. The TUniConnection component connected properly.

To check this I dropped a TMySQLUniProvider and a TUniTable and then checked the TUniTable’s TableName property drop-down and it properly retrieved the table nmes from the server.

I have tried adding “SpecificOptions.Protocol = mpSSL” to the DataAbstract connection string. Without that setting DA gives an error about SSL being required. With the setting DA gives the

SSL_do_handshake = -1
SSL_get_err(…,r2) = 1

error message.

can you show what options would be set if connection was created manually in runtime?
by other hand, you can look at .dfm and see what exactly were set.
probably UniDAC wizard sets something additionally …

Here is the exact .DFM that connects correctly:

object Form1: TForm1
Left = 0
Top = 0
Caption = ‘Form1’
ClientHeight = 299
ClientWidth = 635
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = ‘Tahoma’
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object con1: TUniConnection
ProviderName = ‘MySQL’
Port = 3306
SpecificOptions.Strings = (
‘MySQL.Protocol=mpSSL’)
Username = {deleted for security reasons}
Server = {deleted for security reasons}
Connected = True
LoginPrompt = False
Left = 48
Top = 40
EncryptedPassword = {deleted for security reasons}
end
end

can you check that you have SSL libraries in your path or near .exe ?
if UniDAC uses OpenSSL, it should be like libeay32.dll and ssleay32.dll

Open SSL libraries are installed in the system path as well as the rad studio bin folder where bds.exe is installed and it is in the Everwood bin folder.

Still no luck. The error is still there.

Any new suggestions as to how to fix this issue?

Thank you

pls read https://forums.devart.com/viewtopic.php?t=34147 , you may need to specify your certificate details …