We have configured ProxySQL with Orchestrator to allow a front-end client to connect to two Percona servers running master slave replication. When disabling backend SSL, there are no connection issues between ProxySQL and Percona:
+-------------------------+------+------------------+-------------------------+---------------+
| hostname | port | time_start_us | connect_success_time_us | connect_error |
+-------------------------+------+------------------+-------------------------+---------------+
| master_percona_server | 3306 | 1657560485825536 | 8610 | NULL |
| slave_percona_server | 3306 | 1657560484730191 | 36817 | NULL |
+-------------------------+------+------------------+-------------------------+---------------+
However, when enabling SSL on all servers and specifying both mysql-ssl_p2s_cert and mysql-ssl_p2s_key in ProxySQL, the following errors occur:
+-------------------------+------+------------------+-------------------------+----------------------------------------------+
| hostname | port | time_start_us | connect_success_time_us | connect_error |
+-------------------------+------+------------------+-------------------------+----------------------------------------------+
| master_percona_server | 3306 | 1657560922780474 | 0 | Lost connection to MySQL server during query |
| slave_percona_server | 3306 | 1657560921681621 | 0 | Lost connection to MySQL server during query |
+-------------------------+------+------------------+-------------------------+----------------------------------------------+
These are things we have already considered:
- Copied LetsEncrypt Certbot fullchain.pem and privkey.pem into /var/lib/proxysql
- chmod 600 fullchain.pem and privkey.pem
- chown proxysql:proxysql fullchain.pem and privkey.pem
- No errors when starting ProxySQL ([INFO] SSL keys/certificates found in datadir (/var/lib/proxysql): loading them)
Questions:
- Does anyone have any thoughts on why might coming across this connection error?
- We also have SSL enabled on the front-end client. When connecting to Percona through ProxySQL without specifying the path of mysql-ssl_p2s_cert and mysql-ssl_p2s_key in ProxySQL:
$ mysql -h127.0.0.1 -P6033 -utest_user -ptest_password -e 'SHOW SESSION STATUS LIKE "Ssl_cipher"'
The output is:
+---------------+------------------------+
| Variable_name | Value |
+---------------+------------------------+
| Ssl_cipher | TLS_AES_256_GCM_SHA384 |
+---------------+------------------------+
This should indicate that the connection session is encrypted. Therefore, is it even necessary to configure backend SSL on ProxySQL?