Sqlalchemy, Postgres and SSL

2,826 views
Skip to first unread message

mando

unread,
May 6, 2011, 10:05:58 AM5/6/11
to sqlalchemy
Hi, how can I set my sqlalchemy engine to connect to a postgres on
remote setting the ssl mode as allow?

Thanks a lot!

Luca

Michael Bayer

unread,
May 6, 2011, 9:42:16 PM5/6/11
to sqlal...@googlegroups.com
this would look like:

e = create_engine("postgresql+psycopg2://scott:tiger@host/dbname", connect_args={'sslmode':'require'})

or

e = create_engine("postgresql+psycopg2://scott:tiger@host/dbname?sslmode=require")


SSL for psycopg2 is described at:

http://initd.org/psycopg/docs/module.html#psycopg2.connect
http://www.postgresql.org/docs/9.0/static/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS

> --
> You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
> To post to this group, send email to sqlal...@googlegroups.com.
> To unsubscribe from this group, send email to sqlalchemy+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
>

mando

unread,
May 7, 2011, 6:52:53 AM5/7/11
to sqlalchemy
Now it run properly....I just needed to upgrade my SA module to
0.6....
Best regards!

Luca
Reply all
Reply to author
Forward
0 new messages