Encryted connection to MySQL database server

Dear developers,

I have written a Delphi program that connects online to a MySQL database server. A connection is therefore established directly with the MySQL database.
To establish the connection I use the ConnectionString:

ADOConnection.ConnectionString:= ‘Driver={MySQL ODBC 8.0 ANSI-Driver};’ +
‘Server=’ + Server_IP + ‘;’ +
‘Port=’ + Server_Poort + ‘;’ +
‘Database=’ + Naam_Database + ‘;’ +
‘User=’ + Gebruikersnaam + ‘;’ +
‘Password=’ + Wachtwoord + ‘;’ +
‘Option=3;’ +
‘SslMode=REQUIRED;’;

When the connection is established I get the error message that SSL is not supported by the MySQL server.

What can I do to establish an encrypted connection? I do not manage the MySQL server myself, but it is managed by my host. What can/should I do to secure the connection myself?

Thank you in advance,

Connect to the server via non-SSL. Run SHOW GLOBAL VARIABLES LIKE '%ssl%' and see if SSL is configured on the server side. If it is not, then you need to have your host reconfigure MySQL with the proper CA, server-cert, and server-key pem files. You will need the client-cert files, signed by the same CA in order to establish an SSL connection.

Dear Matthew,

Thank you very much for taking my request for help. I logged into the server via MySQL Workbench and ran the SQL:

SHOW GLOBAL VARIABLES LIKE ‘%ssl%’.

The SSL is disabled.

I am not very experienced with MySQL configuration, but I think it is a fantastic learning experience.

I still have to see how I can add a screenshot of the MySQL Workbenck.

What can I do to activate the SSL connection?

The server must be configured to handle SSL connections. Your host provider must do this. They need to create a server and client pair of SSL certificates, signed by the same CA. They will configure MySQL with the CA and server certs, and then provide you with the client cert to use in your code.

There is nothing you can do from your end if the server is not properly configured.

1 Like

Ok! Thank very much! That’s right, you already mentioned that in your previous post.
I’ll reply again as soon if the host has established this.

But is this demanding or difficult for the host to perform? (It is a shared server).

Thanks again!

Marcel

Some of my customers have a host that does offer an SSL connection. I don’t need to include a client certificate in my code. An encrypted connection is simply established via the connection String (see my first message).

Does this concern another type of connection or host?

Not at all. Less than 10 minutes to generate the requisite SSL certs, then restart MySQL. Step-by-step instructions if you want to send it to them.

If their MySQL server has at minimum, a CA installed, then they can create SSL connections. If your host has nothing, then there’s nothing you can do to create an SSL connection.