Has there been any progress in connecting through SSL with DAL? Searching 
chapter 6 (DAL) of the web2py book for "ssl" or "secure" does not find 
anything. 


On Sunday, August 23, 2009 at 6:01:11 PM UTC+2, mdipierro wrote:
>
> We do not support that but now that I know it should be easy to add. 
> We will add it in the next version. 
>
> Please help us test it. Edit gluon.sql.py and change 
>
>             msg = \ 
>                 "dbname='%s' user='%s' host='%s' port=%s 
> password='%s'"\ 
>                  % (db, user, host, port, passwd) 
>             self._pool_connection(lambda : psycopg2.connect(msg)) 
>
>
> with 
>
>             msg = \ 
>                 "dbname='%s' user='%s' host='%s' port=%s password='%s' 
> sslmode='require'"\ 
>                  % (db, user, host, port, passwd) 
>             self._pool_connection(lambda : psycopg2.connect(msg)) 
>
> does it work? 
>
> Massimo 
>
> On Aug 23, 10:57 am, Don Lee <sam...@gmail.com> wrote: 
> > Yes.  PostgreSQL allows for an SSL connection between the client and the 
> > server.  This can be done with psycopg2, for example: 
> > 
> > import psycopg2 as database 
> > db = database.connect (host="db.host.com", 
> >      sslmode="require", 
> >      database="dbname", 
> >      user="dbuser", 
> >      password="dbpass") 
> > 
> > On Sun, Aug 23, 2009 at 10:04 AM, mdipierro <mdipie...@cs.depaul.edu> 
> wrote: 
> > 
> > > Then I do not understand what you mean by "secure connection". Is 
> > > there a secure connection function provided by postgresql and psycopg2 
> > > that web2py is not using and should be using? 
> > 
> > > Massimo 
> > 
> > > On Aug 23, 8:14 am, Don <sam...@gmail.com> wrote: 
> > > > I do not have SSH access to the DB server.  Can I use psycopg2 
> > > > directly to create the connection? 
> > 
> > > > On Aug 23, 8:59 am, mdipierro <mdipie...@cs.depaul.edu> wrote: 
> > 
> > > > > Yes but not this way. 
> > > > > You have to open an ssh tunner outside web2py and then instruct 
> web2py 
> > > > > to connect to the database using the port used by the tunnel. 
> > 
> > > > > Massimo 
> > 
> > > > > On Aug 23, 7:47 am, Don <sam...@gmail.com> wrote: 
> > 
> > > > > > Is it possible to define a secure database connection? 
> > 
> > > > > > Ex: db = DAL(‘postgres://user:password@hostname/db’, pools=10, 
> > > > > > secure=True) 
> > 
> > > > > > My production DB and web servers are running on a different 
> machines.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to