mfenniak / pg8000

A Pure-Python PostgreSQL Driver
http://pythonhosted.org/pg8000/
Other
222 stars 55 forks source link

cannot set SSL trust roots #148

Closed glyph closed 5 years ago

glyph commented 6 years ago

RDS uses a custom trust root for SSL on RDS databases. Therefore, in order to securely use an RDS database with PG8000, it is necessary to set ssl=True and to also pass a custom value to ssl.wrap_socket's ca_certs parameter. pg8000 does not currently allow this, or provide any public API hook to insert one's own transport mechanism.

glyph commented 6 years ago

I've filed a related issue against sqlalchemy: https://bitbucket.org/zzzeek/sqlalchemy/issues/4146/common-handling-of-sslmode-and-sslrootcert but it might be nice if pg8000 itself had a URL-based connection mechanism as well, that mirrored libpq's.

tlocke commented 5 years ago

Thanks for the PR, I've added this now.