sorry, but forgot to mention,
when i change to sslmode=allow, it lets me connect and runs my query
on 'select * from test_table' which is a dummy table ...
[root(at)localhost serv]# ./bin/test_lib
ret=0
GOT CONNECTION
NAME AGE
----------------------------
me 1
you 2
they 3
us 4
[root(at)localhost serv]#