PQconnectdb SSL (sslmode)

From: vishal saberwal <vishalsaberwal(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, tjtoocool(at)phreaker(dot)net
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: PQconnectdb SSL (sslmode)
Date: 2005-08-26 01:20:52
Message-ID: 3e74dc2505082518204bf8afe8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

hi,
I am not sure if this is a bug.

My PG_HBA.CONF
----------------------------
local all all trust
host all all 127.0.0.1 255.255.255.255 trust
host all all 192.168.0.0/16 trust
hostssl dbm all 192.168.200.201 255.255.255.255 md5

int ret=PQconnectdb("hostaddr=192.168.200.10 dbname=dbm user=postgres
sslmode=prefer");

' ret' prints -1.

Now when I change the above function to one with sslmode=allow, the
connection is established and query runs.

I do have (ssl=true) in postgresql.conf and have tested the
certificates and they are working right. I also restart the postmaster
after every change in postgresql.conf and pg_hba.conf.

I would prefer the connections are SSL and hence would like to use the
default "prefer" sslmode.

vish

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message vishal saberwal 2005-08-26 01:30:18 Re: Ref: BUG#1321: SSL error: sslv3 alert handshake failure
Previous Message Gennadiy.Donchyts 2005-08-25 23:50:59 Re: BUG #1844: Failed to start service 'PostgreSQL Database Server 8.0'