A while ago Chris was reflecting on adding support for libpq connection
strings, and we ("we") have Ticket #62 to add SSL support. I've been
meaning to point out these both work OK today. Passing connection
strings in the dbname parameter works with 9.5.5 of libpq, and the
documentation for 8.3 says it was supported then, too.
If I have this:
db = pq.DB('dbname=testdb host=testhost sslmode=require')
and I'll get this error:
pg.InternalError: server does not support SSL, but SSL was required
or I can have this:
db = pq.DB('dbname=livedb host=insecurehost sslmode=require')
and it will connect and send my x509 certificate.
You can mix a connection string in the dbname parameter to connect with
named parameters as well. URLs and pg_service entries also work
db = pg.DB('service=badtestdb')
pg.InternalError: server does not support SSL, but SSL was required
db = pg.DB('postgresql://testhost/testdb?sslmode=verify-ca')
pg.InternalError: server does not support SSL, but SSL was required
--
Patrick TJ McPhee <[email protected]>
_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql