[SR-Users] Can't start Kamailio with both db_postgres and tls

Daniel-Constantin Mierla miconda at gmail.com
Wed Jan 7 11:49:21 CET 2015


On 06/01/15 10:19, Øyvind Kolbu wrote:
>
> On 19.12.2014 19:17, James Cloos wrote:
>>>> FATAL:  no pg_hba.conf entry for host "129.240.1.1", user
>>>> "foo_test_user", database " foo_test", SSL off
>> there is an extra space, " foo_test" vs "foo_test".
>>
>> That might turn out to be the entire issue.
>>
> Sorry for the late reply, been gone on vacation.
>
> The extra space in my redacted log is not the issue. The issue is that
> somehow when I enable
> the tls module in Kamailio, I can not connect to my postgres server
> anymore. Our server requires
> SSL, and the error message is returned from the server as a result of
> Kamailio not connecting with
> or attempting SSL anymore for db_postgres.
>
Searching on google about libpq and tls I found the notes about SSL
Initialization at:

- http://www.postgresql.org/docs/9.3/static/libpq-ssl.html

Scroll down the page.

Can you try adding:

PQinitSSL(0);

inside function:

struct pg_con* db_postgres_new_connection(struct db_id* id)

in file:

modules/db_postgres/km_pg_con.c

Before line with:

ptr->con = PQsetdbLogin(id->host, ports, ...

If works, we have to make that optional via modparam or try auto-detect
if ssl is initialized (finding tls is loaded, but some other modules can
do it, even when tls is not initialized, so mod param could be a safe way).

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda




More information about the sr-users mailing list