In order to encrypt the connection between the SQL Gateway and the MySQL database by SSL, perform the following steps:
The installation of the SQL Gateway contains a batch file that creates self-signed certificates for the MySQL server.
As a prerequisite for executing the batch file, OpenSSL must be installed on the PC. To obtain OpenSSL, visit http://www.openssl.org.
Proceed as follows:
Step |
Action |
Details |
---|---|---|
1 |
Open the batch file. |
In the tab, select . |
2 |
Adapt the batch file template. |
|
3 |
Execute the batch file. |
Three certificates are created:
|
4 |
Copy the root certificate and the server certificate to the data directory of the MySQL server. Copy the client certificate to the PC running the SQL Gateway. |
– |
5 |
Adapt the my.ini file of the MySQL server as described in the Configuring the MySQL Server section. |
– |
6 |
Restart the MySQL server. |
– |
7 |
Import the client certificate to the certificate store as described in the Managing Certificates in the Certificate Store section of this document. |
Result: The client certificate and the root certificate are imported. |
Adapt the my.ini file of the MySQL server.
To activate SSL and to use the server certificate for SSL encrypted connections, set the options , , , as indicated in the following example using the default MySQL data folder.
Insert the following lines at the end of the my.ini file.
ssl
ssl-ca=ca.pem
ssl-cert=server-cert.pem
ssl-key=server-key.pem
Configure this optional step if the client certificates should be verified by the MySQL database before the connection is established.
To achieve this, set up the SSL options of the by executing the command ALTER USER
:
Command |
Description |
---|---|
|
Requests a certificate from the client. |
|
Allows access to clients providing a certificate that complies to the defined |
|
Allows access to clients providing a certificate that complies to the defined |
For MySQL connections, the tab of the SQL Gateway allows you to configure how to evaluate server certificates.
If the parameter
is set to , the parameter provides the following options:
option |
Description |
---|---|
|
The SQL Gateway computer validates the server certificate. |
|
The SQL Gateway computer validates the server certificate and verifies the name.
NOTE: If this option is used, the parameter must match the subject name in the server certificate.
|
|
The server certificate is not verified by the SQL Gateway computer. |
WARNING | |
---|---|
For MySQL connections, the tab of the SQL Gateway allows you to select a client certificate to be used for the SSL connection to the MySQL server.
If the parameter
is set to , the parameter provides the following options:
option |
Description |
---|---|
|
Select the option if no client certificate is provided. |
|
Select the option .pfx file. The following parameters are additionally displayed: if a client certificate is provided as a
|
|
Select the option certificate store. The following parameters are additionally displayed: if the client certificate is installed in a
|