Closed jdearing-neudesic closed 3 years ago
As you can see from the trace, Pyrseas uses pgdbconn
(see https://github.com/perseas/pgdbconn) which in turn relies on Psycopg2. Pgdbconn used to be part of Pyrseas but we split it because I thought perhaps we could use it in other related projects, but that never panned out. It's a very slim wrapper around psycopg2 and perhaps at this stage it could be put back into Pyrseas.
In any case, Psycopg2 doesn't have much to say about SSL either and I'm afraid I've never used SSL, programmatically with psycopg. As I understand, what would be needed is to add the libpq sslmode
parameter to the pgdbconn DbConnection.__init__
method, so that it could be used when it invokes psycopg2's connect
. In a pinch, you could edit the dbconn.py
file in pgdbconn to add the sslmode
parameter to the connection string on line 43. It seems that by default, sslmode
is prefer
(implying SSL should normally work, see https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS), but perhaps Azure has special needs.
@dvarrazzo knows much more about this than I do, like if there some way to specify the sslmode in envvars or something like that, so hopefully he can comment here too.
You can use env vars such as PGSSLMODE
to work around pgdbconn
getting in the way.
It seems like the issue was with the particular user and it worked fine with the admin user.
I am trying to run Pyrseas against an azure postgres database that requires an azure connection. I get
`FATAL: SSL connection is required. Please specify SSL options and retry.
Full stack:
this github repo doesn't mention anything about SSL.