Page 1 of 1

Connect to external MySql database with TLS

Posted: 02.08.2022, 15:34
by FlemmingH
I have been using Zeoslib with Putty tunnel to connect to my external database and it have been working fine for years :D But then my host sells out and i'm forced to move my site to another host. After setting it all up i realize that i can't connect with SSH because the MySql server doesn't provide ftp access. The only security protocol the provider offers is TLS, but i can't find anything explanation on how to use TLS protocols in ZeosLib? Isn't it supported?

Re: Connect to external MySql database with TLS

Posted: 05.08.2022, 08:24
by Fr0sT
Umm, I don't know precisely but it should be only the matter of proper client lib configuration. Zeos has nothing to do with transport layer. Have you read corresponding MySQL docs?

Re: Connect to external MySql database with TLS

Posted: 05.08.2022, 11:57
by MJFShark
I'm no expert on MySQL or TLS however I was able to get an SSL connection (or at least connect) by using the database property:

MYSQL_SSL=TRUE

It also seemed that I had to use the mariadb client as the mysql one that I tried didn't appear to support ssl.

More info:
viewtopic.php?f=19&t=129183

-Mark

Re: Connect to external MySql database with TLS

Posted: 06.08.2022, 14:10
by FlemmingH
Thanks both of you.

It seems that i don't have to be concerned then. When i read the 'Ssl_cipher' from the established connection i get 'DHE-RSA-AES256-SHA'. As i understand it that's a thumbs up on SSL connection. I didn't need to set the MYSQL_SSL=TRUE.

Hopefully i'm right in my assumption and can close this thread.

Re: Connect to external MySql database with TLS

Posted: 04.05.2023, 16:56
by Bruce27
Just in case this helps anyone else, I am connecting to a remote MySQL 8.0 database using SSL. On the server, I have set up a remote user for whom SSL is required.

Using Zeoslib with Lazarus/Free Pascal (from Windows 11 Pro 64-bit), I have set up a connection with the libmariadb.dll connector.

When I DON'T include MYSQL_SSL=TRUE in the connector properties, I get a "User access denied" error.

When I DO include MYSQL_SSL=TRUE in the connector properties, I can connect without any problem.

To summarize, my set-up is:

Lazarus 2.2.2 with Free Pascal 3.2.2, all 64-bit.
MySQL 8.0.32 hosted on a remote VPS.
Zeol version 7.2.14.
libmariadb.dll connector taken from a 64-bit WAMP installation of MariaDB 10.11.