From 93d0ddf4773f4cbc5a03fd9354f3b71ec01a046b Mon Sep 17 00:00:00 2001 From: Rahim Kanji Date: Mon, 6 Apr 2026 14:06:23 +0500 Subject: [PATCH] fix: add pgsql_servers_ssl_params to tablenames vector and fix monitor fallback - Add pgsql_servers_ssl_params to pgsql_servers_tablenames so SAVE/LOAD PGSQL SERVERS TO/FROM DISK correctly persists and restores SSL params. - Fix monitor SSL fallback to use per-server params directly (empty fields omitted) instead of per-field fallback to globals, matching the backend connection behavior. --- lib/PgSQL_Monitor.cpp | 10 +++++----- lib/ProxySQL_Admin.cpp | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/PgSQL_Monitor.cpp b/lib/PgSQL_Monitor.cpp index 2c2ff07dc..39ef010e3 100644 --- a/lib/PgSQL_Monitor.cpp +++ b/lib/PgSQL_Monitor.cpp @@ -452,11 +452,11 @@ vector ext_srvs(const unique_ptr& srvs_info) { }; if (ssl_params != nullptr) { return mon_srv_t::ssl_opts_t { - ssl_params->ssl_key.length() > 0 ? ssl_params->ssl_key : string { pgsql_thread___ssl_p2s_key ? pgsql_thread___ssl_p2s_key : "" }, - ssl_params->ssl_cert.length() > 0 ? ssl_params->ssl_cert : string { pgsql_thread___ssl_p2s_cert ? pgsql_thread___ssl_p2s_cert : "" }, - ssl_params->ssl_ca.length() > 0 ? ssl_params->ssl_ca : string { pgsql_thread___ssl_p2s_ca ? pgsql_thread___ssl_p2s_ca : "" }, - ssl_params->ssl_crl.length() > 0 ? ssl_params->ssl_crl : string { pgsql_thread___ssl_p2s_crl ? pgsql_thread___ssl_p2s_crl : "" }, - ssl_params->ssl_crlpath.length() > 0 ? ssl_params->ssl_crlpath : string { pgsql_thread___ssl_p2s_crlpath ? pgsql_thread___ssl_p2s_crlpath : "" } + ssl_params->ssl_key, + ssl_params->ssl_cert, + ssl_params->ssl_ca, + ssl_params->ssl_crl, + ssl_params->ssl_crlpath }; } } diff --git a/lib/ProxySQL_Admin.cpp b/lib/ProxySQL_Admin.cpp index 5b4073224..3b8a2a077 100644 --- a/lib/ProxySQL_Admin.cpp +++ b/lib/ProxySQL_Admin.cpp @@ -153,6 +153,7 @@ static const vector pgsql_servers_tablenames = { // "pgsql_galera_hostgroups", // "pgsql_aws_aurora_hostgroups", "pgsql_hostgroup_attributes", + "pgsql_servers_ssl_params", }; static const vector mysql_firewall_tablenames = {