From eeae005fb3d5239dd6e3af727504fc829ea5a0fb Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Sun, 25 Jan 2015 11:00:28 +0100 Subject: [PATCH] db_postgress: disable initialization of libssl if tls is loaded - based on the note from docs to avoid double attempt to init the ssl library - http://www.postgresql.org/docs/9.4/static/libpq-ssl.html (cherry picked from commit f04dec82e90ec7a3e6aea4ea8e9ed23b06b165c6) Conflicts: modules/db_postgres/km_pg_con.c --- modules/db_postgres/km_pg_con.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/db_postgres/km_pg_con.c b/modules/db_postgres/km_pg_con.c index de89d857a1d..a8e04947efa 100644 --- a/modules/db_postgres/km_pg_con.c +++ b/modules/db_postgres/km_pg_con.c @@ -29,6 +29,7 @@ #include "../../mem/mem.h" #include "../../dprint.h" #include "../../ut.h" +#include "../../tls_hooks_init.h" #include #include @@ -74,6 +75,9 @@ struct pg_con* db_postgres_new_connection(struct db_id* id) ZSW(id->database)); } + /* don't attempt to re-init openssl if done already */ + if(tls_loaded()) PQinitSSL(0); + ptr->con = PQsetdbLogin(id->host, ports, NULL, NULL, id->database, id->username, id->password); LM_DBG("PQsetdbLogin(%p)\n", ptr->con);