diff --git a/lib/PgSQL_Monitor.cpp b/lib/PgSQL_Monitor.cpp index 4db02cf77..7090ecad3 100644 --- a/lib/PgSQL_Monitor.cpp +++ b/lib/PgSQL_Monitor.cpp @@ -876,11 +876,12 @@ string build_conn_str(const task_st_t& task_st) { return string { "host='" + srv_info.addr + "' " - + "port='" + std::to_string(srv_info.port) + "' " - + "user='" + user_info.user + "' " - + "password='" + user_info.pass + "' " - + "dbname='" + user_info.dbname + "' " - + "application_name=ProxySQL-Monitor" + + "port='" + std::to_string(srv_info.port) + "' " + + "user='" + user_info.user + "' " + + "password='" + user_info.pass + "' " + + "dbname='" + user_info.dbname + "' " + + "application_name=ProxySQL-Monitor " + + (srv_info.ssl ? "sslmode=require " : "sslmode=disable ") }; }