How to configure OmniFabric SSL connection
Overview
This document describes how to configure your OmniFabric server to use SSL for database connections. After you secure your OmniFabric connections, malicious users cannot intercept your traffic.
Configure OmniFabric SSL connections
Create the directory to store the SSL keys
To create the directory that will contain the SSL keys, perform the following steps:
-
Log into your server via SSH. Check if you have the
mysql_ssl_rsa_setuptool in place. Usually if you have installed MySQL, themysql_ssl_rsa_setupbinary will also be installed.If you try to execute this command
mysql_ssl_rsa_setupand you see this following message, it means you have installed it. If not, please install MySQL first, and thismysql_ssl_rsa_setupwill be installed along. You can also check the path ofmysql_ssl_rsa_setupbinary file withwhereis mysql_ssl_rsa_setup.[pcusername@VM-0-12-centos OmniFabric]$ mysql_ssl_rsa_setup 2022-10-19 10:57:30 [ERROR] Failed to access directory pointed by --datadir. Please make sure that directory exists and is accessible by mysql_ssl_rsa_setup. Supplied value : /var/lib/mysql [pcusername@VM-0-12-centos OmniFabric]$ whereis mysql_ssl_rsa_setup mysql_ssl_rsa_setup: /usr/bin/mysql_ssl_rsa_setup /usr/share/man/man1/mysql_ssl_rsa_setup.1.gz -
Create an SSL key storage directory that OmniFabric can access. For example, run the
mkdir /home/user/mo_keyscommand to create amo_keysdirectory.
Create the SSL keys
To create the SSL keys, perform the following steps:
-
Run the following commands to create the Certificate Authority (CA) keys:
mysql_ssl_rsa_setup --datadir=/home/user/mo_keysYou'll see in this folder a list of
.pemfiles./mo_keys
├── ca-key.pem
├── ca.pem
├── client-cert.pem
├── client-key.pem
├── private_key.pem
├── public_key.pem
├── server-cert.pem
└── server-key.pem -
Insert the following lines in the
[cn.frontend]section of theetc /launch-with-proxy/cn.tomlfile in OmniFabric folder:[cn.frontend] enableTls = true tlsCertFile = "/home/user/mo_keys/server-cert.pem" tlsKeyFile = "/home/user/mo_keys/server-key.pem" tlsCaFile = "/home/user/mo_keys/ca.pem"If
[cn.frontend]section doesn't exist in the OmniFabric system setting file, you can just create one with the above settings.
Test the SSL configuration
To test the SSL configuration, perform the following steps:
-
Launch OmniFabric service. Please refer to Deploy standalone OmniFabric.
-
Connect to OmniFabric service by MySQL client:
mysql -h IP_ADDRESS -P 6001 -uroot -p111 -
After you connect, run the
statuscommand. The output will resemble the following example:mysql> status -------------- mysql Ver 8.0.28 for Linux on x86_64 (MySQL Community Server - GPL) Connection id: 1001 Current database: Current user: root@0.0.0.0 SSL: Cipher in use is TLS_AES_128_GCM_SHA256 Current pager: stdout Using outfile: '' Using delimiter: ; Server version: 8.0.30-OmniFabric-v2.1.0 OmniFabric Protocol version: 10 Connection: 127.0.0.1 via TCP/IP Client characterset: utf8mb4 Server characterset: utf8mb4 TCP port: 6002 Binary data as: Hexadecimal --------------