diff --git a/Plugins/SQL/Targets/PostgreSQL.cpp b/Plugins/SQL/Targets/PostgreSQL.cpp index 4926845663a..3c3574d2507 100644 --- a/Plugins/SQL/Targets/PostgreSQL.cpp +++ b/Plugins/SQL/Targets/PostgreSQL.cpp @@ -34,6 +34,7 @@ void PostgreSQL::Connect() const std::string host = "host=" + Config::Get("HOST", "localhost"); const std::string user = "user=" + *Config::Get("USERNAME"); const std::string pass = "password=" + *Config::Get("PASSWORD"); + const std::string sslmode = "sslmode=" + Config::Get("SSL_MODE", "disable"); // Database technically is optional. If not given, it will connect to the default // database of the given USERNAME. @@ -47,7 +48,7 @@ void PostgreSQL::Connect() const std::string port = "port=" + Config::Get("PORT", "5432"); // Build the m_connection string - this is used later in the PQping (PQping doesn't need the password). - m_connectString = host + " " + port + " " + db + " " + user ; + m_connectString = host + " " + port + " " + db + " " + user + " " + sslmode; // hide the password in the log file LOG_INFO("Connect String: %s password=xxxxxxxx", m_connectString);